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
GETAPI call happens before thePUTAPI call has completed (looking into browser's network tab). I expect thePUTrequest to complete first, followed by theGETrequest to fetch the updated data.Steps to reproduce the behavior:
GETandPUTrequests.onSuccesscallback to invalidate the query after the mutation is successful.API functions
Custom hook for fetching and updating items
Expected behavior
The
PUTrequest should complete first, and then theGETrequest 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