You can see the type problem in the reproduction code. The provided linter will highlight it and there's a comment on the appropriate line pointing at the extra type definition required to work around the problem.
You can also see that the option is merged correctly with the default options by making use of the GraphQL playground. Visit the /graphql route in the embedded browser and query for query { errors }. You will see the extra logging line output correctly.
Expected behavior
The type definition should be updated to allow for this option to be passed.
Is there an existing issue for this?
Current behavior
The type definition for
GQLModuleOptions
doesn't acceptformatError
, making it impossible to intercept errors as they are emitted.Minimum reproduction code
https://stackblitz.com/edit/nestjs-typescript-starter-ny1xwh?file=src/app.module.ts
Steps to reproduce
You can see the type problem in the reproduction code. The provided linter will highlight it and there's a comment on the appropriate line pointing at the extra type definition required to work around the problem.
You can also see that the option is merged correctly with the default options by making use of the GraphQL playground. Visit the
/graphql
route in the embedded browser and query forquery { errors }
. You will see the extra logging line output correctly.Expected behavior
The type definition should be updated to allow for this option to be passed.
Package version
10.1.6
Graphql version
"@nestjs/apollo": "^10.1.6", "@nestjs/common": "^9.0.0", "@nestjs/core": "^9.0.0", "@nestjs/graphql": "^10.1.6", "@nestjs/platform-express": "^9.0.0", "apollo-server-express": "^3.11.1", "graphql": "^16.6.0",
NestJS version
9.0.0
Node.js version
16.14.2
In which operating systems have you tested?
Other
No response