Query vs Mutation error handling #1612
Unanswered
ramihamati
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am new to graphql and apollo, but I noticed a behaviour which seems confusing to me.
I am using asp .net Hotchocollate for the backend and angular with apollo for the frontend.
If I query for data and an error occurs, I return an error which is catched in the next() callback of the observable. Here I can handle the error in ApolloQueryResult.Error/Errors
-> This behaviour is valid because all returns are 200OK and errors are handled in the errors array
If I mutate and and an error occurs, I return a similar error but in this case it's catched in the err() callback of the observable as an ApolloError
-> This behaviour is different then the one I have in the query.
Is this the right behaviour or there is something I am missing?
Beta Was this translation helpful? Give feedback.
All reactions