useInfiniteQuery
info
- Your procedure needs to accept a cursorinput of any type (string,number, etc)
- 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
getInfiniteData()
This helper gets the currently cached data from an existing infinite query
components/MyComponent.tsxtsx
components/MyComponent.tsxtsx
setInfiniteData()
This helper allows you to update a query's cached data
components/MyComponent.tsxtsx
components/MyComponent.tsxtsx