-
-
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
Catch query error #265
Comments
Currently, I don't think there is a way. Maybe you should open an issue in apollo-client? |
I think this issue should be reopened. On queries, even if we have an error handler, the console still gets the error printed. I don't believe this is an apollo-client problem. Looking at the vue-apollo code in The library is correctly catching the error and passing it to the callback, but it's also pushing the error to the console. I think we should have an option (or the default) to suppress errors if |
I look forward for this feature ! |
It's already released! 😸 |
Hello, maybe I'm missing something but how can i fix this?
I'm still getting back the printed out message instead of the error object that contains the data that i need to analyze... any help please? |
FYI for anyone else that runs into this, your error handler has to return a truthy value if you want to stop the error propagation. See line 163 and 165 here: Example: errorHandler (error) {
if (isNotFound(error)) {
router.history.updateRoute(router.match('/not_found'))
return true // we handled the error, stop propagation
} |
If anyone reads this issue and is using
Hope it helps 😃 |
i have the last version with the "fix" but error still shows as "Error: GraphQL error: Unable to to be identified ..." not a proper json |
Have anyone found any workaround for this? |
Try this
|
I am facing the same issue. I just can't figure out a way how to access the "errors" array:
|
Errors array located in response error js object. You may find it in "Error.response". |
Just to comment on this incase further people face this issue as I did today. This was the solution I found that works: |
I am working with the
node-advanced
boilerplate (https://github.com/graphql-boilerplates/node-graphql-server/tree/master/advanced), currently I want to catch the error thrown server-side when I check if the user is logged in. Therefore I have the following query:The
error(error){...}
function is called, which is good. So I am able to know that there was an error. Right now theerror(error){...}
function is called after the error appears in the console. However, I want to catch this error so that it is not thrown in the console. Is there a way to do this?With mutations I can succesfully catch the error:
Is there a way to really catch the errors when performing a query, not a mutation?
Thanks in advance!
The text was updated successfully, but these errors were encountered: