queryClient.refetchQueries() not working when previous mutation failed due to api error #7939
Unanswered
royanonuevo
asked this question in
General
Replies: 1 comment
-
help me.please |
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.
-
The "duplicateJob" mutation is working fine when previous api call is 200/ok, even when I tried to call the deleteMutation and then call the duplicateMutation again is still working (queryClient.refetchQueries() works),
But when I tried to call "deleteMutation" and if its failed then I tried to call "duplicateMutation" again, duplicateMutation works and its onSuccess was called but the "queryClient.invalidateQueries({ queryKey: [QUERY_TAG_JOBS] })" not working
I noticed also: when i tried to delete via mutate and if there is error from api, the context of my query tag was gone when i checked in my dev tools. So when i tried to mutate(POST) again it succeed but the queryClient.refetchQueries() not working.
Upon Page Reload:


When I delete a specific job that will trigger error, I noticed that the query tag ["jobs"] is gone
etc:



Beta Was this translation helpful? Give feedback.
All reactions