From 73e2adb62f631628a6ac9878831beb5533baa80d Mon Sep 17 00:00:00 2001 From: cayter Date: Thu, 16 Jul 2020 02:08:35 +0800 Subject: [PATCH] chore: tweak GraphQL playground default settings --- pack/template.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pack/template.go b/pack/template.go index 552c1a91..fd98a3bb 100644 --- a/pack/template.go +++ b/pack/template.go @@ -115,6 +115,7 @@ func gqlPlaygroundTpl(path string, c *Context) []byte { var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)'); return v ? v[2] : null; } + window.addEventListener('load', function (event) { GraphQLPlayground.init(document.getElementById('root'), { endpoint: '` + path + `', @@ -123,8 +124,11 @@ func gqlPlaygroundTpl(path string, c *Context) []byte { 'X-CSRF-Token': unescape(getCookie("` + mdwCSRFAuthenticityTemplateFieldName(c) + `")) }, settings: { + 'editor.reuseHeaders': false, 'request.credentials': 'include', - 'schema.polling.interval': 5000 + 'schema.polling.interval': 30000, + 'tracing.hideTracingResponse': true, + 'tracing.tracingSupported': true } }) })