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
When using useMutation and setting a callback handler in the hook options as well as a handler in the mutate function options, both handlers are called when an error occurs. According to the docs this should not happen.
If you provide the same option to both useMutation and your mutate function, the mutate function's value takes precedence.
Intended outcome:
Only the mutate function onError callback should be called.
Actual outcome:
Both callback handlers are called.
When using
useMutation
and setting a callback handler in the hook options as well as a handler in the mutate function options, both handlers are called when an error occurs. According to the docs this should not happen.Intended outcome:
Only the mutate function
onError
callback should be called.Actual outcome:
Both callback handlers are called.
How to reproduce the issue:
Repo can be found here reproducing the issue:
https://github.com/leepowelldev/apollo-client-bug-2
Versions
System:
OS: macOS 13.0.1
Binaries:
Node: 18.12.1 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.19.2 - /usr/local/bin/npm
Browsers:
Chrome: 107.0.5304.110
Edge: 107.0.1418.42
Firefox: 106.0.5
Safari: 16.1
npmPackages:
@apollo/client: ^3.7.1 => 3.7.1
The text was updated successfully, but these errors were encountered: