Replies: 6 comments 26 replies
-
Additionnal info: when I unfocus/focus on the app, it works well, the fetching is done again and my data are correct. And queryCache.clear() does the trick but it's not what I want for sure. |
Beta Was this translation helpful? Give feedback.
-
+1 anybody figured it out yet? 😄 |
Beta Was this translation helpful? Give feedback.
-
queryClient.invalidateQueries also works for infinite queries. Per default, it will refetch all pages, but we now also have a |
Beta Was this translation helpful? Give feedback.
-
is there a solution yet. For me if i invalidate the query only last page gets refetched and rendered. I want to fetch all of the pages |
Beta Was this translation helpful? Give feedback.
-
i tried this
and then when I am trying queryClient.invalidateQueries(["getAllCases"]); |
Beta Was this translation helpful? Give feedback.
-
Hello, @TkDodo I still have an issue with invalidating the infinity query.
While the component where I am using infinity query mounted, I can invalidate the data and it data will be refetched. As soon as I unmount this component and invalided data anywhere else and returned back I could see that state invalidated true, but the data is not refetching. For regular queries works fine. As workaround I use refetch method in case the query is Invalidted.
My infinity query code
|
Beta Was this translation helpful? Give feedback.
-
I do something like this on a click:
and in my list, I do this:
My query is correctly done, with the right collection of IDs. However, my list doesn't refresh well.
I do something like this:
Both of my requets are refetched, but the data are quite frozen there:
watchedBillsInfiniteQuery?.data
any idea?
Beta Was this translation helpful? Give feedback.
All reactions