diff --git a/graphiql.go b/graphiql.go index d997374..b024086 100644 --- a/graphiql.go +++ b/graphiql.go @@ -8,13 +8,13 @@ import ( "github.com/graphql-go/graphql" ) -// page is the page data structure of the rendered GraphiQL page -type graphiqlPage struct { +// graphiqlData is the page data structure of the rendered GraphiQL page +type graphiqlData struct { GraphiqlVersion string QueryString string - ResultString string VariablesString string OperationName string + ResultString string } // renderGraphiQL renders the GraphiQL GUI @@ -50,23 +50,23 @@ func renderGraphiQL(w http.ResponseWriter, params graphql.Params) { resString = string(result) } - p := graphiqlPage{ + d := graphiqlData{ GraphiqlVersion: graphiqlVersion, QueryString: params.RequestString, ResultString: resString, VariablesString: varsString, OperationName: params.OperationName, } - - err = t.ExecuteTemplate(w, "index", p) + err = t.ExecuteTemplate(w, "index", d) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } + return } // graphiqlVersion is the current version of GraphiQL -const graphiqlVersion = "0.11.10" +const graphiqlVersion = "0.11.11" // tmpl is the page template to render GraphiQL const graphiqlTemplate = ` @@ -85,21 +85,27 @@ add "&raw" to the end of the URL within a browser.