You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When calling mutateAsync from the useUpsertMutation hook the data is refetched once per the number of rows updated in the upsert.
To Reproduce
To reproduce put a useQuery hook and useUpsertMutation hook in the same file for the same table. They should both fetch and update an array of rows.
Expected behavior
The refetch should only happen once for the upsert mutation
Additional context
I was trying to figure out why this would be. I confirmed that when I just update a single row there is only one api request. Is there anywhere in the repo you could point me that is responsible for this behavior?
The text was updated successfully, but these errors were encountered:
I think this is related to how react query works. In SWR, we set revalidateIfStale to false (docs) and explicit set revalidate to false when doing the mutation
Describe the bug
When calling mutateAsync from the useUpsertMutation hook the data is refetched once per the number of rows updated in the upsert.
To Reproduce
To reproduce put a useQuery hook and useUpsertMutation hook in the same file for the same table. They should both fetch and update an array of rows.
Expected behavior
The refetch should only happen once for the upsert mutation
Additional context
I was trying to figure out why this would be. I confirmed that when I just update a single row there is only one api request. Is there anywhere in the repo you could point me that is responsible for this behavior?
The text was updated successfully, but these errors were encountered: