graphql-yoga
graphql-yoga copied to clipboard
Plugins not working in nestjs
Describe the bug
GraphQLModule.forRoot<YogaDriverConfig>({
driver: YogaDriver,
autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
sortSchema: true,
logging: 'debug',
landingPage: false,
// graphiql: false,
healthCheckEndpoint: '/live',
context: ({ req, res }) => ({ req, res }),
plugins: [
useSofa({
basePath: '/rest',
swaggerUI: {
endpoint: '/swagger',
spec: {
info: {
title: 'My API',
version: '1.0.0',
description: 'This is a sample API',
},
},
},
}),
useReadinessCheck({
endpoint: '/ready', // default
check: async () => {
try {
// await checkDbAvailable();
// if true, respond with 200 OK
return true;
} catch (err) {
// log the error on the server for debugging purposes
console.error(err);
// if false, respond with 503 Service Unavailable and no bdy
return false;
}
},
}),
useExecutionCancellation(),
useCSRFPrevention({
requestHeaders: ['x-graphql-yoga-csrf'], // default
}),
useResponseCache({
// global cache
session: () => null,
cache,
}),
useAPQ(),
],
}),
/live not working /swagger not working /rest not working /ready not working
Your Example Website or App
https://github.com/SOG-web/yoga-nestjs
Steps to Reproduce the Bug or Issue
just set up a simple code first gql nestjs server
Expected behavior
those endpoint should be working
Screenshots or Videos
No response
Platform
- OS: macOS
- NodeJS: 20+
-
"@graphql-yoga/nestjs": "^3.6.1"
Additional context
No response