Infinite query and filters #7697
Unanswered
guhadebasish1
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a page where I display product tiles with useInfiniteQuery hook.
There are a few filters on the page. When these filters change, I use useMutation to get the filtered result and then use setQueryData to update the RQ cache.
The issue that I am having is after I manually update the cache with results from useMutation, the initial useInfiniteQuery hook runs and I lose the filtered data.
Is combining useInfiniteQuery, useMutation even the correct approach?
Any advice is highly appreciated.
**Edit**
I realized useInfiniteQuery is another form of useQuery and it fires when queryKey changes. I was able to work through all my issues with that in mind.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions