Request State Issue - Need To Access Query Metadata(?) #7531
Unanswered
peter-batley-depop
asked this question in
General
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.
-
Context
Is there any way to neatly achieve my desired functionality with the current API?
I believe that this is a difficult problem because my request has a dependency that does not belong in the query key (the uuid). The mapping from query key to UUID is 1:many, because we need a new one each time the query goes stale.
Current Hack - leveraging page params
useInfiniteQuery
useInfiniteQuery
resultqueryFn
, try to uselastPage.uuid
and fall back to the optimistic UUIDThis solution ensures that page 0 fetches (i.e. 'new' requests) always use a new UUID. And the page params hack ensures that subsequent pages of a query retain a consistent UUID.
Beta Was this translation helpful? Give feedback.
All reactions