Global onSuccess callback in the MutationCache , interferes with local onSuccess used in useMutation hooks. #7890
Unanswered
emekaokoli
asked this question in
Q&A
Replies: 1 comment
-
that shouldn't have any influence. please show a minimal reproduction |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I've been using the global
mutationCachefor invalidating updates, and I've been relying on theonSuccessstatus to navigate away from the page when it'strue. However, I've noticed thatonSuccessalways returnsfalse, even when the mutation is successful. When I commented out themutationCachesection, I found thatonSuccessstarts working as intended, returningtrueorfalsebased on the mutation outcome.Now, I'm wondering if there's a way to use both the global invalidation and have
onSuccessreturn the desired status of eithertrueorfalse.// where onSuccess is used.
Also, here's the version I am using:
"@tanstack/react-query": "^5.28.4",Beta Was this translation helpful? Give feedback.
All reactions