Replies: 1 comment 4 replies
-
Looks legit to me :) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I might be using
useInfiniteQuery
in an unconventional way but here it goes.The idea is that I want to render the table of items immediately after the first page loads, and then keep querying and appending the items until there aren't any pages left. The api I am using returns data in this manner:
For example:
This works fine and does exactly what I need it to do. The issue begins when I add
staleTime
like so:Now after adding this, here is what happens:
The first set of results comes back along with a
nextToken
. 10 seconds goes by and then the next page is requested. rinse and repeat until no more pages available.Now I believe this is only a bug when using the query in this unconventional way. However I'd like to see what y'all think because I'm not able to use
usePaginatedQuery
in the way I'd like to due to the API constraints and UI requirements I have. Although I'm all ears if there is a reasonable way to make this work another way.Thanks
Beta Was this translation helpful? Give feedback.
All reactions