Skip to content
Discussion options

You must be logged in to vote

If you are not happy with how error masking works you can disable error masking and implement your own error handling through a plugin.

import { createServer } from "@graphql-yoga/node"

createServer({
  maskedErrors: false,
  plugins: [
    useYourCustomErrorHandlerPlugin(),
  ]
}).start()

You can learn more about error masking in the tutorial or error masking documentation.

I know that we can configure custom errors by using GraphQLYogaError class, but it doesn't seem to be useful at all as we need to traverse through objects and do conditional checks to display the error messages in the frontend.

In general, I would recommend you model your expected errors as GraphQLObjectTypes using…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Salmandabbakuti
Comment options

@n1ru4l
Comment options

Answer selected by n1ru4l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants