0Pricing
tRPC End-to-End Type Safe APIs · Lesson

Infinite Queries and Cursor-Based Pagination

Implement scalable list loading in tRPC using cursor-based pagination and infinite queries for endless scroll.

Why Not Offset Pagination?

Offset pagination (page 1, 2, 3) breaks when data changes between requests and gets slow on large tables.

Cursor-based pagination uses a pointer to the last item, staying fast and stable.

The Cursor Concept

Each page returns items plus a nextCursor, the id or timestamp of where the next page should start.

All lessons in this course

  1. Efficient Batching Requests
  2. Implementing Optimistic Updates
  3. File Uploads with tRPC
  4. Infinite Queries and Cursor-Based Pagination
← Back to tRPC End-to-End Type Safe APIs