diff --git a/graphiql.go b/graphiql.go index b024086..32b7103 100644 --- a/graphiql.go +++ b/graphiql.go @@ -66,7 +66,7 @@ func renderGraphiQL(w http.ResponseWriter, params graphql.Params) { } // graphiqlVersion is the current version of GraphiQL -const graphiqlVersion = "0.11.11" +const graphiqlVersion = "3.8.3" // tmpl is the page template to render GraphiQL const graphiqlTemplate = ` @@ -100,8 +100,8 @@ add "&raw" to the end of the URL within a browser. - - + + @@ -143,12 +143,13 @@ 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 = {headers: {}}) { return fetch(fetchURL, { method: 'post', headers: { 'Accept': 'application/json', - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + ...opts.headers }, body: JSON.stringify(graphQLParams), credentials: 'include',