chore(other): replace the page cursor fields with nextPage and previousPage - #22
Merged
Merged
Conversation
There was a problem hiding this comment.
AI Review: 🟢 Completed
Redocly Agent has reviewed your changes and found 1 potential issue(s).
Note
Medium Risk
Introduces breaking changes to the pagination schema across list endpoints by removing existing cursor and total count fields, requiring client and server implementations to update their pagination handling.
Overview
- Updates the
Pageschema to replaceendCursor,startCursor,hasNextPage, andhasPrevPagewith nullablenextPageandpreviousPagestring fields. - Removes the
totalcount property fromPageand updates the required properties to[nextPage, previousPage, limit]. - Updates descriptions for
AfterandBeforequery parameters to referencenextPageandpreviousPage.
DmitryAnansky
approved these changes
Sep 21, 2026
DmitryAnansky
left a comment
Collaborator
There was a problem hiding this comment.
@DaveTheWebDev
Looks good, please merge together with the API changes or it short interval.
So that API was in sync with the API description.
Thx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
pageobject in list responses changes shape.Removed:
endCursor,startCursor,hasNextPage,hasPrevPage,total.Added:
nextPage,previousPage.Kept:
limit.All three remaining fields are required. The
afterandbeforeparameterdescriptions now point at the fields that replace the old cursors.
Why
A cursor is
nullexactly when there is no page in that direction, sohasNextPageandhasPrevPagerepeated what the cursors already said. Twofields could disagree with each other, and clients had to decide which one to
trust. One signal per direction removes that ambiguity.
Dropping
totalkeeps list responses cheap: a total forces the server to countevery matching row on every request, however few rows the client asked for.
Migration
page.endCursorwithpage.hasNextPagepage.nextPagepage.startCursorwithpage.hasPrevPagepage.previousPagePage forward until
nextPageisnull, and backward untilpreviousPageisnull. Clients that displayed a result count frompage.totalneed to drop it.Testing
npx @redocly/cli@latest lintpasses, with the warnings already present on thedefault branch and none in the changed files.