useInfiniteQuery

info
  • Your procedure needs to accept a input of any type
  • For more details on infinite queries read the react-query docs
  • In this example we’re using Prisma - see their docs on

Example React Component

  1. function MyComponent() {
  2. const myQuery = trpc.useInfiniteQuery(
  3. 'infinitePosts',
  4. {
  5. },
  6. ],
  7. getNextPageParam: (lastPage) => lastPage.nextCursor,
  8. },
  9. );
  10. }