From e150c9d8d41545905fb8ebb2cbcb5ca7eca7402b Mon Sep 17 00:00:00 2001 From: Bervianto Leo Pratama Date: Mon, 18 Apr 2022 12:50:59 +0700 Subject: [PATCH 1/6] Update graphiql version --- graphiql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphiql.go b/graphiql.go index b024086..8f6c4a9 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 = "1.8.7" // tmpl is the page template to render GraphiQL const graphiqlTemplate = ` From b9781c229c6c04d11b0f7e0de43f033bad5179fe Mon Sep 17 00:00:00 2001 From: Bervianto Leo Pratama Date: Mon, 18 Apr 2022 13:01:26 +0700 Subject: [PATCH 2/6] Update react version --- graphiql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphiql.go b/graphiql.go index 8f6c4a9..d6ff99c 100644 --- a/graphiql.go +++ b/graphiql.go @@ -100,8 +100,8 @@ add "&raw" to the end of the URL within a browser. - - + + From eeb4ca7cdfacb01e1c606cfe9690975600943c2a Mon Sep 17 00:00:00 2001 From: Bervianto Leo Pratama Date: Mon, 18 Apr 2022 13:08:18 +0700 Subject: [PATCH 3/6] Change react path --- graphiql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphiql.go b/graphiql.go index d6ff99c..8272c17 100644 --- a/graphiql.go +++ b/graphiql.go @@ -100,8 +100,8 @@ add "&raw" to the end of the URL within a browser. - - + + From f697c663306130b6d088c91dc60cc23495ab3929 Mon Sep 17 00:00:00 2001 From: Bervianto Leo Pratama Date: Mon, 18 Apr 2022 13:12:16 +0700 Subject: [PATCH 4/6] Fix path should use production --- graphiql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphiql.go b/graphiql.go index 8272c17..5308497 100644 --- a/graphiql.go +++ b/graphiql.go @@ -100,8 +100,8 @@ add "&raw" to the end of the URL within a browser. - - + + From 7fb3fc16eff5872788cdb0460981bef7800ad549 Mon Sep 17 00:00:00 2001 From: Bervianto Leo Pratama Date: Mon, 18 Apr 2022 13:22:21 +0700 Subject: [PATCH 5/6] Add headers --- graphiql.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/graphiql.go b/graphiql.go index 5308497..ef839ee 100644 --- a/graphiql.go +++ b/graphiql.go @@ -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', From 6fa14a315b76b2d11b3f3aee84279ea9ef062a25 Mon Sep 17 00:00:00 2001 From: Bervianto Leo Pratama Date: Mon, 18 Apr 2022 13:24:15 +0700 Subject: [PATCH 6/6] Missing bracket --- graphiql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphiql.go b/graphiql.go index ef839ee..b1912cc 100644 --- a/graphiql.go +++ b/graphiql.go @@ -143,7 +143,7 @@ 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, opts = {headers: {}) { + function graphQLFetcher(graphQLParams, opts = {headers: {}}) { return fetch(fetchURL, { method: 'post', headers: {