Skip to content

Commit

Permalink
Fix sending of custom headers
Browse files Browse the repository at this point in the history
  • Loading branch information
chentsulin committed Nov 24, 2021
1 parent 1465ec8 commit 428f392
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/renderGraphiQL.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,16 @@ add "&raw" to the end of the URL within a browser.
}
var fetchURL = locationQuery(otherParams);
// Defines a GraphQL fetcher using the fetch API.
function graphQLFetcher(graphQLParams) {
function graphQLFetcher(graphQLParams, opts) {
return fetch(fetchURL, {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
headers: Object.assign(
{
'Accept': 'application/json',
'Content-Type': 'application/json'
},
opts && opts.headers,
),
body: JSON.stringify(graphQLParams),
credentials: 'include',
}).then(function (response) {
Expand Down

0 comments on commit 428f392

Please sign in to comment.