seniorGraphQL

How does Cursor-based Pagination work and why is it preferred over Offset-based?

Updated Apr 28, 2026

Short answer

Cursor pagination uses a unique identifier (cursor) for a specific row to fetch subsequent rows, ensuring stable pagination.

Deep explanation

Offset pagination (LIMIT 10 OFFSET 20) skips rows, which becomes extremely slow on large datasets and causes items to be missed or duplicated if new data is inserted during pagination. Cursor pagination (WHERE id > cursor LIMIT 10) is highly performant (using indexes) and perfectly stable.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More GraphQL interview questions

View all →