-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
No way to get an underlying GraphQL error from RelayMutationTransaction's onFailure #696
Comments
Thanks for asking about this. Relay creates error objects with a |
Ah sweet, that is exactly what I needed...guess I missed it. Thanks! |
That's odd, I'm getting an object of type |
@rapilabs are you using the default network layer? If yes, and the error property is not what's documented then it's a bug (and worth filing a new issue). |
How would you show that message to the end user? I was thinking about using redux for that, but.. that looks like an overkill. |
@mloncaric: You could use |
Using transaction.getError().source ..but should be included in docs... |
@somit you saved me from writing a whole custom error handler. |
No way to get an underlying GraphQL error from RelayMutationTransaction's
onFailure
:The problem is
transaction.getError()
in theonFailure
callback only gives me access to a RelayError
, which means I can't get at the underlying GraphQLError
:GraphQL errors are likely more user friendly than the Relay errors. I think
onFailure
should get passed the underlying GraphQL errors somehow to let tools choose which (Relay or GraphQL) is important for their use-case.The text was updated successfully, but these errors were encountered: