Skip to content

Commit

Permalink
enable graphiql header editor
Browse files Browse the repository at this point in the history
  • Loading branch information
koenpunt committed Sep 21, 2021
1 parent 02b16bd commit 34f464b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@
></script>
<script>
function graphQLFetcher(path) {
return graphQLParams => fetch(
return (graphQLParams, options = {}) => fetch(
`${location.protocol}//${location.host}${path}`,
{
method: 'post',
headers: {
...options.headers,
Accept: 'application/json',
'Content-Type': 'application/json',
},
Expand All @@ -86,6 +87,7 @@
React.createElement(GraphiQL, {
fetcher: gqlFetcher,
defaultVariableEditorOpen: true,
headerEditorEnabled: true
}),
document.getElementById('graphiql'),
);
Expand Down

0 comments on commit 34f464b

Please sign in to comment.