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