-
-
Notifications
You must be signed in to change notification settings - Fork 933
Closed
Description
API Platform version(s) affected: 3.1.5
Description
When you specify headers in GraphiQL, they are not sent in http headers request.
How to reproduce
Open GraphiQL UI, set a header, open a console with network view, send the request.
No Atuhorization header is present.
Possible Solution
Referer to issue graphql/graphiql#3005 (comment), we need to add headers in graphQLFetcher function in file src/Symfony/Bundle/Resources/public/init-graphiql.js.
function graphQLFetcher(graphQLParams, {headers}) {
return fetch(entrypoint, {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
...headers
},
Now the headers are send.
Metadata
Metadata
Assignees
Labels
No labels