Skip to content
Discussion options

You must be logged in to vote

.mutate doesn't return a Promise because it does error handling for you. you can use either the provided onSuccess callback on .mutate to continue:

updateUserSettingsMutation.mutate({...}, { onSuccess: () => { continue here })

or use mutateAsync, which returns a Promise. But if you use mutateAsync, please make sure to also handle errors with either .catch or with try/catch in an async function to avoid unhandled promise rejections.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by D-Thrane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants