useInfiniteQuery
info
- Your procedure needs to accept a cursorinput ofanytype
- For more details on infinite queries read the react-query docs
- In this example we're using Prisma - see their docs on cursor-based pagination
Example Procedure
server/routers/_app.tstsx
server/routers/_app.tstsx
Example React Component
components/MyComponent.tsxtsx
components/MyComponent.tsxtsx
Helpers
getInfiniteQueryData()
This helper gets the currently cached data from an existing infinite query
components/MyComponent.tsxtsx
components/MyComponent.tsxtsx
setInfiniteQueryData()
This helper allows you to update a queries cached data
components/MyComponent.tsxtsx
components/MyComponent.tsxtsx