Skip to content

Commit

Permalink
fastify gql plugin awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
dthyresson committed May 17, 2023
1 parent 6efefc1 commit 66706f0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -51,7 +52,7 @@ async function serve() {
},
})

fastify.register(redwoodFastifyGraphQLServer, {
await fastify.register(redwoodFastifyGraphQLServer, {
loggerConfig: {
logger: logger,
options: { query: true, data: true, level: 'trace' },
Expand All @@ -62,6 +63,11 @@ async function serve() {
directives,
allowIntrospection: true,
allowGraphiQL: true,
allowedOperations: [
OperationTypeNode.SUBSCRIPTION,
OperationTypeNode.QUERY,
OperationTypeNode.MUTATION,
],
})

// Start
Expand Down

0 comments on commit 66706f0

Please sign in to comment.