-
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
useMutation data is always undefined, only works in onCompleted #7556
Comments
Seems to be solved by this, but I cant see a release with it #8018 |
@sfratini The change in that PR is available in v3.3.16: https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md#apollo-client-3316 |
FYI this is still an issue on 3.3.20. |
@sfratini I don't see it when I update to 3.3.20 in https://codesandbox.io/s/nostalgic-firefly-rjhw7. Could you tweak that reproduction until it demonstrates the issue you're seeing? |
Actually I take that back. It does work, it just seems to show the data and then reset the value to undefined but it could just be my environment refreshing the state. |
Closing because it seems like this has been fixed at some point by some person 😶 |
How have you fixed that? |
The problem still insists and is inconsistent |
Intended outcome:
I am using the below mutation to update a tile object. The data in the
onCompleted
callback is correctly returning the updated data object. The data I'm returning in my wrapper is always undefined now. This seems to have recently changed and I'm not sure whyActual outcome:
I expect the data returned from the useMutation to contain the updated data object instead of being undefined. This was recently working as intended.
How to reproduce the issue:
Haven't been able to replicate in a codesandbox environment, it must be some other factor.
https://codesandbox.io/s/competent-visvesvaraya-ifzp9?file=/src/App.js
Versions
The text was updated successfully, but these errors were encountered: