From 66706f0479eaa70c3189a842c32ca33823d50d61 Mon Sep 17 00:00:00 2001 From: David Thyresson Date: Tue, 16 May 2023 11:38:04 -0400 Subject: [PATCH] fastify gql plugin awaits --- .../commands/experimental/templates/server.ts.template | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/experimental/templates/server.ts.template b/packages/cli/src/commands/experimental/templates/server.ts.template index 8e4a42c51a00..05dc6991342c 100644 --- a/packages/cli/src/commands/experimental/templates/server.ts.template +++ b/packages/cli/src/commands/experimental/templates/server.ts.template @@ -4,6 +4,7 @@ import path from 'path' import chalk from 'chalk' import { config } from 'dotenv-defaults' import Fastify from 'fastify' +import { OperationTypeNode } from 'graphql' import { coerceRootPath, @@ -51,7 +52,7 @@ async function serve() { }, }) - fastify.register(redwoodFastifyGraphQLServer, { + await fastify.register(redwoodFastifyGraphQLServer, { loggerConfig: { logger: logger, options: { query: true, data: true, level: 'trace' }, @@ -62,6 +63,11 @@ async function serve() { directives, allowIntrospection: true, allowGraphiQL: true, + allowedOperations: [ + OperationTypeNode.SUBSCRIPTION, + OperationTypeNode.QUERY, + OperationTypeNode.MUTATION, + ], }) // Start