@@ 103,16 103,18 @@ func (server *Server) WithSchema(
handler.RecoverFunc(EmailRecover),
handler.UploadMaxSize(1073741824)) // 1 GiB (TODO: configurable?)
- if config.Debug {
- server.router.Handle("/",
- playground.Handler("GraphQL playground", "/query"))
- }
server.router.Handle("/query", srv)
// These don't need auth or any other middleware - just log and process
server.root.Group(func(r chi.Router) {
r.Use(middleware.RealIP)
r.Use(middleware.Logger)
+
+ if config.Debug {
+ play := playground.Handler("GraphQL playground", "/query")
+ r.Handle("/", play)
+ }
+
r.Handle("/query/metrics", promhttp.Handler())
r.Get("/query/api-meta.json", func(w http.ResponseWriter, r *http.Request) {
info := struct {