graphql/yoga-server/tutorial/basic/09-error-handling #3137
Replies: 2 comments 2 replies
-
I had an error with PrismaClientKnownRequestError - would not compiled: This is the suggested solution:
For catching the error:
Docs reference https://www.prisma.io/docs/concepts/components/prisma-client/handling-exceptions-and-errors |
Beta Was this translation helpful? Give feedback.
1 reply
-
For me, app crashes with Promise rejection. return Promise.reject(
new GraphQLError(`Cannot post comment on non-existing link with id '${args.linkId}'.`)
) Now, returning just the error, gives me the result I need return new GraphQLError(`Cannot post comment on non-existing link with id '${args.linkId}'.`) Making a note to return the error instead of making promise rejections in my code. This might be related to a new API change, hope you can take a look at this matter and if needed update the tutorial code! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
graphql/yoga-server/tutorial/basic/09-error-handling
Learn the origin of this error and learn how to properly handle it.
https://the-guild.dev/graphql/yoga-server/tutorial/basic/09-error-handling
Beta Was this translation helpful? Give feedback.
All reactions