(node:8356) UnhandledPromiseRejectionWarning: Error: No type definitions were found with the specified file name patterns: "./**/*.graphql". Please make sure there is at least one file that matches the given patterns.
at GraphQLTypesLoader.<anonymous> (E:\NestJS\Template_Login\teample-api-backend-nestjs\backend\node_modules\@nestjs\graphql\dist\graphql-types.loader.js:38:23)
at Generator.next (<anonymous>)
at fulfilled (E:\NestJS\Template_Login\teample-api-backend-nestjs\backend\node_modules\tslib\tslib.js:114:62)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:8356) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async
function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8356) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I ran into the same issue. This is most likely caused by the fact that the .graphql files are ignored in build time and not copied to /dist. Interestingly, I didn't have that before and the build seemed to complete just fine, it appeared only today.
I found a workaround to the problem proposed by the NestJS creator: https://github.com/nestjs/graphql/issues/135
https://docs.nestjs.com/cli/monorepo#assets
There is assets
option in nestjs.
This is the right way to do it in nestjs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With