From b9547ff0aca11e1022eba738c3873d8615ff1520 Mon Sep 17 00:00:00 2001 From: "d.berezhnoy" Date: Sun, 15 Aug 2021 20:21:27 +0300 Subject: [PATCH 1/4] feat: update script dependencies and add new configuration for graphiql --- graphiql.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/graphiql.go b/graphiql.go index b024086..bd3cf97 100644 --- a/graphiql.go +++ b/graphiql.go @@ -10,7 +10,6 @@ import ( // graphiqlData is the page data structure of the rendered GraphiQL page type graphiqlData struct { - GraphiqlVersion string QueryString string VariablesString string OperationName string @@ -51,7 +50,6 @@ func renderGraphiQL(w http.ResponseWriter, params graphql.Params) { } d := graphiqlData{ - GraphiqlVersion: graphiqlVersion, QueryString: params.RequestString, ResultString: resString, VariablesString: varsString, @@ -65,9 +63,6 @@ func renderGraphiQL(w http.ResponseWriter, params graphql.Params) { return } -// graphiqlVersion is the current version of GraphiQL -const graphiqlVersion = "0.11.11" - // tmpl is the page template to render GraphiQL const graphiqlTemplate = ` {{ define "index" }} @@ -97,12 +92,12 @@ add "&raw" to the end of the URL within a browser. height: 100vh; } - + - - - + + +
Loading...
@@ -195,6 +190,9 @@ add "&raw" to the end of the URL within a browser. response: {{ .ResultString }}, variables: {{ .VariablesString }}, operationName: {{ .OperationName }}, + shouldPersistHeaders: true, + editorTheme: "solarized dark", + headerEditorEnabled: true, }), document.getElementById('graphiql') ); From 62e035de8e6485992a77643892ab4815ba610893 Mon Sep 17 00:00:00 2001 From: "d.berezhnoy" Date: Sun, 15 Aug 2021 20:29:50 +0300 Subject: [PATCH 2/4] fix: return graphiqlVersion --- graphiql.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/graphiql.go b/graphiql.go index bd3cf97..c70fd7d 100644 --- a/graphiql.go +++ b/graphiql.go @@ -10,6 +10,7 @@ import ( // graphiqlData is the page data structure of the rendered GraphiQL page type graphiqlData struct { + GraphiqlVersion string QueryString string VariablesString string OperationName string @@ -50,6 +51,7 @@ func renderGraphiQL(w http.ResponseWriter, params graphql.Params) { } d := graphiqlData{ + GraphiqlVersion: graphiqlVersion, QueryString: params.RequestString, ResultString: resString, VariablesString: varsString, @@ -63,6 +65,9 @@ func renderGraphiQL(w http.ResponseWriter, params graphql.Params) { return } +// graphiqlVersion is the current version of GraphiQL +const graphiqlVersion = "0.2.2" + // tmpl is the page template to render GraphiQL const graphiqlTemplate = ` {{ define "index" }} From a96f9c30f036aed657fa78a19e97ba8cebc81d95 Mon Sep 17 00:00:00 2001 From: "d.berezhnoy" Date: Sun, 29 Aug 2021 09:52:33 +0300 Subject: [PATCH 3/4] feat: add theme to graphiql --- go.mod | 9 +++++++-- go.sum | 4 ++++ graphiql.go | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 go.sum diff --git a/go.mod b/go.mod index 05720f0..7d20c8e 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,8 @@ -module github.com/graphql-go/handler +module github.com/Moranilt/handler -go 1.14 +go 1.16 + +require ( + github.com/graphql-go/graphql v0.7.9 + github.com/graphql-go/handler v0.2.3 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..c621f73 --- /dev/null +++ b/go.sum @@ -0,0 +1,4 @@ +github.com/graphql-go/graphql v0.7.9 h1:5Va/Rt4l5g3YjwDnid3vFfn43faaQBq7rMcIZ0VnV34= +github.com/graphql-go/graphql v0.7.9/go.mod h1:k6yrAYQaSP59DC5UVxbgxESlmVyojThKdORUqGDGmrI= +github.com/graphql-go/handler v0.2.3 h1:CANh8WPnl5M9uA25c2GBhPqJhE53Fg0Iue/fRNla71E= +github.com/graphql-go/handler v0.2.3/go.mod h1:leLF6RpV5uZMN1CdImAxuiayrYYhOk33bZciaUGaXeU= diff --git a/graphiql.go b/graphiql.go index c70fd7d..81531fa 100644 --- a/graphiql.go +++ b/graphiql.go @@ -103,6 +103,7 @@ add "&raw" to the end of the URL within a browser. +
Loading...
From df9674d6dfccfb887a79b6f5e7bd716a0c19e66f Mon Sep 17 00:00:00 2001 From: "d.berezhnoy" Date: Sun, 5 Sep 2021 17:52:07 +0300 Subject: [PATCH 4/4] chore: change version of graphiql --- go.mod | 7 ++----- go.sum | 6 ++---- graphiql.go | 3 +-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 7d20c8e..8687144 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,5 @@ -module github.com/Moranilt/handler +module github.com/graphql-go/handler go 1.16 -require ( - github.com/graphql-go/graphql v0.7.9 - github.com/graphql-go/handler v0.2.3 -) +require github.com/graphql-go/graphql v0.8.0 diff --git a/go.sum b/go.sum index c621f73..a02c8ea 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,2 @@ -github.com/graphql-go/graphql v0.7.9 h1:5Va/Rt4l5g3YjwDnid3vFfn43faaQBq7rMcIZ0VnV34= -github.com/graphql-go/graphql v0.7.9/go.mod h1:k6yrAYQaSP59DC5UVxbgxESlmVyojThKdORUqGDGmrI= -github.com/graphql-go/handler v0.2.3 h1:CANh8WPnl5M9uA25c2GBhPqJhE53Fg0Iue/fRNla71E= -github.com/graphql-go/handler v0.2.3/go.mod h1:leLF6RpV5uZMN1CdImAxuiayrYYhOk33bZciaUGaXeU= +github.com/graphql-go/graphql v0.8.0 h1:JHRQMeQjofwqVvGwYnr8JnPTY0AxgVy1HpHSGPLdH0I= +github.com/graphql-go/graphql v0.8.0/go.mod h1:nKiHzRM0qopJEwCITUuIsxk9PlVlwIiiI8pnJEhordQ= diff --git a/graphiql.go b/graphiql.go index 81531fa..40f986e 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.2.2" +const graphiqlVersion = "0.11.11" // tmpl is the page template to render GraphiQL const graphiqlTemplate = ` @@ -197,7 +197,6 @@ add "&raw" to the end of the URL within a browser. variables: {{ .VariablesString }}, operationName: {{ .OperationName }}, shouldPersistHeaders: true, - editorTheme: "solarized dark", headerEditorEnabled: true, }), document.getElementById('graphiql')