-
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
Fix errorPolicy
on useMutation
hook
#5863
Fix errorPolicy
on useMutation
hook
#5863
Conversation
62e4cde
to
f82222d
Compare
Hello! Is there an ETA as to when will this be merged to master? Thank you! |
Same problem here, any update on this? |
Hey @hwillson, don't mean to be a pain, but do you mind taking a look at this? Multiple people are encountering this issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay here @jamesreggio - this looks great! Thanks!
Thanks! This was a much needed fix for my case |
@jamesreggio @hwillson does the recent merge here mean that updating apollo-client package will include the fix, or do we need to wait for a release? |
@t-lock These changes are now available in |
Hello Apollo folks 👋
The
useMutation
hook exposeserrorPolicy
in its option typings, but doesn't pass the value through to the underlyingmutate
method on theApolloClient
instance.This seems like an oversight, since there's value in being able to specify
errorPolicy: 'all'
and have the hook's mutate function resolve (not reject) with anerror
field.I've fixed this minor bug and wrote some tests to prevent future regressions.
This fix relates to this issue from the deprecated
react-apollo
repo: apollographql/react-apollo#3728