Preserve data on refetch? #2373
Replies: 1 comment 3 replies
-
it doesn't matter if you use rest or graphql. react-query is promise based, so everything that returns a promise works the same. You already have limit and offset as part of the query key, which is good. But where do you store this? This is more of a client-side state managment question. Just incrementing it as a side-effect in the query function (looking at
Look at the pagination example: it keeps the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm very new to react-query and I have difficulties to create lazy loading. All the tutorials Ive found for lazy loading use REST api or Apollo. I'm using GraphQL.
What I have managed to code so far:
Well my pagination works, but I cannot keep the old data on re-fetch. They are erased and replaced with the new data. How should I fix this?
I was looking into useInfiniteQuery but once again I couldnt find any examples using GraphQL, everybody uses REST api and changes the url parameters.
Beta Was this translation helpful? Give feedback.
All reactions