I have a resolver that is called from execute
(graphql
package), and when the backend needs to report an error it throws an internal type (AuthError, etc.) that includes an error code
that the front-end depends on to respond accordingly. However, I have run into an issue where the result from execute
is wrapping this error in a GraphQLError
, which includes the original error as originalError
, but this portion is not getting propagated up to the client.
Here is the Server Side after the error is thrown and before sending the result to the client: (I am using sockets.)
And here is the client side of this:
So, my question is how can I get this code
in the client error? I assume there must be a way to set this extraInfo
that the client side has, but I do not see anything in the docs.