Tanstack query with usePaginatedQuery is not working
usePaginatedQuery. It doesn’t seem to behave as expected, and TypeScript is throwing errors. Here’s the code and the error I’m encountering:Working Example
This works fine:Problematic Code
However, in this usage:I get the following TypeScript error:
Observations
-usePaginatedQuery seems to expect two required arguments: - A query function.
- Query arguments (e.g., an object representing the filters, pagination params, etc.).
- In the problematic code, it seems like TypeScript isn’t recognizing the query arguments or options properly, even though they’re provided.
Questions
1. Am I misunderstanding the correct way to useusePaginatedQuery within convexQuery or ensureQueryData?2. Is this related to how
ensureQueryData works or some conflict with convexQuery?3. Could this be a TypeScript inference issue, and if so, how can I resolve it?
4. Is
usePaginatedQuery still supported in the latest version of TanStack Query?Any help or clarification would be greatly appreciated! If there’s a better pattern for combining
usePaginatedQuery with ensureQueryData, I’d love to know!