Skip to content

Commit

Permalink
jsonOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
reginbald committed Jan 14, 2025
1 parent d2b0873 commit 6da7f0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions graphql/playground/altair_playground.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ var altairPage = template.Must(template.New("altair").Parse(`<!doctype html>

// AltairHandler responsible for setting up the altair playground
func AltairHandler(title, endpoint string, options map[string]interface{}) http.HandlerFunc {
jsonEnv, err := json.Marshal(options)
jsonOptions, err := json.Marshal(options)
if err != nil {
jsonEnv = []byte("{}")
jsonOptions = []byte("{}")
}

return func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -83,7 +83,7 @@ func AltairHandler(title, endpoint string, options map[string]interface{}) http.
"mainSRI": "sha256-bjpcMy7w3aaX8Cjuyv5hPE9FlkJRys0kxooPRtbGd8c=",
"polyfillsSRI": "sha256-+hQzPqfWEkAfOfKytrW7hLceq0mUR3pHXn+UzwhrWQ0=",
"runtimeSRI": "sha256-2SHK1nFbucnnM02VXrl4CAKDYQbJEF9HVZstRkVbkJM=",
"options": string(jsonEnv),
"options": string(jsonOptions),
})
if err != nil {
panic(err)
Expand Down

0 comments on commit 6da7f0e

Please sign in to comment.