-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
useLazyQuery promise .catch not catching errors, when useMutation does #9142
Comments
@MattBred Thanks for reporting this! Seems like this |
I object to the bug label because this is new 3.5 functionality but yeah this seem right to do. Though, I don’t understand why people don’t just call |
I now believe I was wrong above, for the reasons I give in #9684. Throwing Here's an example of an issue in direct conflict with this one: #9669 |
This perhaps gives some reassurance the goals of issue #9142 are still achievable, in the sense that network errors can be obtained from the Promise returned by the useLazyQuery execution function, even if those errors are not thrown (and the Promise is never rejected).
I should be able to add a
.catch
to theuseLazyQuery
promise, which should be called when the response is a graphql or network error. Right now, the.catch
does not fire in either case, and the error is present in the result variable inside the.then
.This is inconsistent with the
useMutation
which does fire the.catch
on errors.Intended outcome:
I should get
query error!
when there is an error.Actual outcome:
I get
query done!
when there is an error.How to reproduce the issue:
Click to open code example
The following example uses the
MockedProvider
but has the exact same result when using the normalApolloProvider
Versions
The text was updated successfully, but these errors were encountered: