-
-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom error message #17
Comments
@jhnferraris custom errors are currently not supported, but I would love to hear more from you on this topic. Could you add this to |
@maticzav Any updates on this? I really want my developers to know what the cause of the error is. For example, |
Since it is still in their roadmap, we opted on using a different approach. We used graphql-resolvers's, |
@jhnferraris If it's not too much trouble, can you give me an example of how custom errors can be implemented? I've already defined all of my schema using |
@dakshshah96 Sure! Example you have a "validation" resolver: Resolver A:
In your main resolver of a certain GraphQL query, let say
Once
Another approach is without the need for an extra resolver (if there's no need for reusability). Let's use your code here as an example:
I hope this helps. :) |
Is it possible to modify the
error
object?Or can we directly use other error handler like apollo-errors instead of using the default "Insufficient permission"
Thanks for the assist!
The text was updated successfully, but these errors were encountered: