Skip to content
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

Prevent undefined mutation result in useMutation #8018

Merged
merged 2 commits into from
Apr 23, 2021

Conversation

jcreighton
Copy link
Contributor

@jcreighton jcreighton commented Apr 22, 2021

Fixes #7754. When an onError handler is provided, the mutation promise returned undefined when it should return a result. We now return a result with data and errors.

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

Copy link
Contributor

@brainkim brainkim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Member

@benjamn benjamn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@jcreighton jcreighton merged commit 9b766ad into main Apr 23, 2021
@jcreighton jcreighton deleted the 7754-useMutation-onError branch April 23, 2021 00:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mutation response is undefined, but shouldn't be
3 participants