Replies: 1 comment 1 reply
-
|
most often, it just means that the keys aren't matching / you're not invalidating the correct query |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I have been using
Queryfor some time now, so i thought i had a clear grasp of how it was working, but suddenly, some piece of my code is not working as intended, so i have double thoughts.I am using a query in a component with
useQuery, showing a list of things.When committing a change (actually a deletion of one element in the list) with a mutation, i invalidate the query in an
onSuccesshandler.It has always been my understanding that the query should then refetch to display the new list, however that is not what happens. My query is not refetching (triple checked with various means, one being the query devtools) and i must force the component to recreate to get updated data.
When using
refetchinstead ofinvalidate, my query refetch and the updated data correctly shows.I suspect this is a bug with the trpc adapter, but i would like to be sure that my understanding of the intended behavior of
Queryis correct.Thank you.
Beta Was this translation helpful? Give feedback.
All reactions