Replies: 1 comment
-
it's technically not possible that the invalidation happens before the mutation finished with the shown code. it's more likely that something else triggers a refetch in between, e.g. a window focus. I can only look into this if you 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.
-
When I invalidate a query after updating an item through a mutation while running my own server locally, I notice that the
GET
API call happens before thePUT
API call has completed (looking into browser's network tab). I expect thePUT
request to complete first, followed by theGET
request to fetch the updated data.Steps to reproduce the behavior:
GET
andPUT
requests.onSuccess
callback to invalidate the query after the mutation is successful.API functions
Custom hook for fetching and updating items
Expected behavior
The
PUT
request should complete first, and then theGET
request should be triggered to fetch the updated data.This issue only occurs when running my own server locally. When using other environments, the requests happen in the expected order.
how this happens?
Beta Was this translation helpful? Give feedback.
All reactions