You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
Hi, I'm working with vue 2.5.3, vuex 3.0.1, apollo-client 2.0.3, apollo-link-error 1.0.1 and apollo-server-express 1.1.7
I'm trying to centralize my error handling with apollo-link-error. So when I expect a GraphQL error or a Network error, everything works great but I'm getting the following error in the console:
Uncaught (in promise) Error: GraphQL error: <<message>> at new ApolloError (ApolloError.js?d743:34)
My workflow is: the vue component calls an async function which triggers the vuex async action that calls the graphql mutation.
@lobosan the onError link doesn't stop the error from going back to Apollo Client (and thus your end components), but rather is a hook to allow you to subscribe to any network related errors to log, handle auth flow, etc.
@jbaxleyiii thanks for your reply. Yeah make sense, so I guess it's not really possible to centralize error handling and resolve all promises inside the error link. Instead I'll do the try/catch in each of my functions that interact with graphql
Is this conclusion still valid in 2020 with the latest Apollo client? We still can't have centralized error handling? We need to handle each error on each component that issues an Apollo query individually?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I'm working with vue 2.5.3, vuex 3.0.1, apollo-client 2.0.3, apollo-link-error 1.0.1 and apollo-server-express 1.1.7
I'm trying to centralize my error handling with apollo-link-error. So when I expect a GraphQL error or a Network error, everything works great but I'm getting the following error in the console:
Uncaught (in promise) Error: GraphQL error: <<message>> at new ApolloError (ApolloError.js?d743:34)
My workflow is: the vue component calls an async function which triggers the vuex async action that calls the graphql mutation.
My code is as follows
Vue component method:
Vuex action:
Apollo Client configuration:
The text was updated successfully, but these errors were encountered: