TanStackT
TanStack5mo ago
4 replies
sacred-rose

Pass a generic infiniteQueryOptions object as parameter

I posted in the main thread but adding a question here... I feel like I'm very close to getting the types working but could just be something that isn't supported

I am struggling with type issues a bit - i am trying to create a generic hook that can take in a infiniteQueryOptions that will ensure a "standard" PaginatedResponse object from the queryFn. I dont have any errors in types on my useGeneric function but when i go to actually use it i run into a type errors with queryKeys being readonly. Is this something that just isn't possible? (https://github.com/TanStack/query/issues/7974) i found this issue but is bit different use case than mine
GitHub
Describe the bug I want to use useQueries to fetch x queries every time, and another y queries, whose count is not known at compile time. Here is a short example (playground below): export const us...
Type Error when using `useQueries` with results returning different...
Was this page helpful?