Skip to content
Wade Womersley

wade.one

wade womersley – york based software engineer

  • Home
  • 2026
  • October
  • 19
  • Pagination Needs a Stable Order Before It Needs a Clever Cursor

Pagination Needs a Stable Order Before It Needs a Clever Cursor

Posted on October 19, 2026 By
Programming

Pagination looks simple until the underlying list changes between requests. If you sort only by a value that several records share, or leave the order to whatever the database happens to return, moving to the next page can skip or repeat items. I would settle the ordering contract before choosing the pagination mechanism.

GitHub’s GraphQL pagination guide is a clear example of following an end cursor and checking whether another page exists. A cursor is useful navigation state, but it is not a magical snapshot of a changing dataset. The API still needs to explain what ordering and consistency a caller can rely on.

For an application list, I want a deterministic sort and a unique tie-breaker. If people change the filters or sort direction, the old cursor should not silently carry on with different assumptions. Page size, empty results and the end of the list also deserve ordinary, predictable behaviour. These are small details that become very visible when somebody is working through hundreds of records.

Offset pagination can be perfectly adequate for a bounded list. Cursor pagination can be a better fit elsewhere. Neither choice excuses an unstable order. Start with what “the next page” means to the user, then choose the simplest mechanism that can keep that promise.

Share:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit

Related

Comments

comments

Tags: apis graphql pagination

Post navigation

❮ Previous Post: USB-C Is a Connector, Not a Promise About the Cable
Next Post: Every Mundane Task Deserves an Overdramatic Soundtrack ❯

You may also like

Programming
C# 14 field-backed Properties Are Small but Useful
June 7, 2026
Programming
GitHub Actions Dependencies Deserve a Lockfile Too
November 9, 2026
Programming
Database Migrations Need to Survive Two App Versions at Once
October 20, 2026
AI
CodeQL’s System Prompt Injection Query Is a Useful Start
July 15, 2026
  • AI
  • artificial intelligence
  • Ego-centric
  • Events
  • Films
  • Food
  • Gaming
  • Gym
  • Hardware
  • Holidays
  • News
  • PHP
  • Programming
  • Random Stuff
  • Reviews
  • Science
  • SEO
  • Software
  • Software Engineer
  • Support
  • Uncategorized
  • Work

Copyright © 2026 wade.one.

Theme: Oceanly News Dark by ScriptsTown