Returning an error object in a resolver without mercurius converting it to GraphQLError? #944
Unanswered
zestsystem
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I'm not sure this is even doable, I don't think it's Mercurius doing the wrapping in GrapHQLError. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, I want to return some errors inside "data" response of my resolvers. However whenever I return a javascript error in a resolver, it gets converted to GraphQLError and the error that should be in userErrors array gets populated in the errors field. I've tried wrapping the Error object following the small "workaround" listed here, but found no success with this:
https://the-guild.dev/blog/graphql-error-handling-with-fp
Any idea on how I should go about getting the mercurius server to ignore the error object being returned? Or more specifically, an array of custom error object extended from Error? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions