-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
'update' is called when 'error' exists and errorPolicy is none
#526
Comments
Looks like a good idea since we don't have any code in vue-apollo compatibled with |
I think I have the same problem as this issue describes. I have an ApolloClient like this:
then I have a graphql server that on some fields have special permissions (using graphql directives). So it returns
|
Was about time 😅 |
Given how this is an important part of error handling in apollo client, perhaps an update to the docs of https://apollo.vuejs.org/ would be helpful? Not everyone is moving to the v4 vue apollo docs at the current slowish pace everyone is updating their libraries to support vue 3... |
If you have a config like this:
and you have graphQLErrors, then update is still called. This is unexpected, and in fact it worked as expected (update is not called) until v3.0.0-beta.10. Then in 878f966, something was changed to hide the GraphQL console error if the error() handler exists.
However, I would expect that vue-apollo respects the errorPolicy of apollo in this case, i.e. by default it's
none
and a graphQLError means any data is ignored. See https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-config-options-errorPolicy (the docs are for react, but the code is in apollo-client. In fact, since react handles errorPolicy, I think vue-apollo should too.The text was updated successfully, but these errors were encountered: