diff --git a/templates/ts-fastify-mongodb-backend/src/index.ts b/templates/ts-fastify-mongodb-backend/src/index.ts index 0fd5c43513..d0b4346f40 100644 --- a/templates/ts-fastify-mongodb-backend/src/index.ts +++ b/templates/ts-fastify-mongodb-backend/src/index.ts @@ -10,6 +10,7 @@ import { loadConfigSync } from 'graphql-config'; import { makeExecutableSchema } from '@graphql-tools/schema'; import { connectDB } from './db'; import { noteResolvers } from './resolvers/noteResolvers'; +import {mergeResolvers} from '@graphql-tools/merge'; async function start() { const app = fastify(); @@ -45,6 +46,7 @@ async function start() { app.register((mercurius as any), { schema, + resolvers: mergeResolvers([resolvers,noteResolvers]), graphiql: true, context: contextCreator, subscription: true