diff --git a/server/server.go b/server/server.go index 601c5f04cac5ef7b20a759b3f304542c564fff44..cae842e6c71409ed15b8eea8de3a320645da002f 100644 --- a/server/server.go +++ b/server/server.go @@ -120,6 +120,14 @@ MaxMemory: 33554432, // 32 MiB (up to this handled in memory) MaxUploadSize: 1073741824, // 1 GiB (TODO: configurable?) }) + if config.Debug { + srv.AroundOperations(func(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler { + oc := graphql.GetOperationContext(ctx) + log.Printf("%s %s", oc.OperationName, oc.RawQuery) + return next(ctx) + }) + } + server.router.Handle("/query", srv) // These don't need auth or any other middleware - just log and process