From be4d0dfd336970b56a58d9da3ff53dcbc888f7c9 Mon Sep 17 00:00:00 2001 From: orelus Date: Fri, 7 Apr 2023 19:12:45 +0200 Subject: [PATCH] fix(graphiql): send headers --- src/Symfony/Bundle/Resources/public/init-graphiql.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/Resources/public/init-graphiql.js b/src/Symfony/Bundle/Resources/public/init-graphiql.js index f1447c27ec4..66c8c505f8c 100644 --- a/src/Symfony/Bundle/Resources/public/init-graphiql.js +++ b/src/Symfony/Bundle/Resources/public/init-graphiql.js @@ -25,12 +25,13 @@ function updateURL() { history.replaceState(null, null, newSearch); } -function graphQLFetcher(graphQLParams) { +function graphQLFetcher(graphQLParams, {headers}) { return fetch(entrypoint, { method: 'post', headers: { 'Accept': 'application/json', - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + ...headers }, body: JSON.stringify(graphQLParams), credentials: 'include'