Skip to content

Add generic backend pagination support for GraphQL cursors#1714

Draft
yesoreyeram wants to merge 6 commits into
mainfrom
yesoreyeram/graphql-pagination-support
Draft

Add generic backend pagination support for GraphQL cursors#1714
yesoreyeram wants to merge 6 commits into
mainfrom
yesoreyeram/graphql-pagination-support

Conversation

@yesoreyeram

Copy link
Copy Markdown
Contributor

Why

GitHub GraphQL cursor pagination was failing in real usage, and pagination handling was effectively limited to narrower backend query paths. This change makes pagination support generic across backend URL query types while fixing cursor-specific behavior needed for GraphQL providers.

What changed

  • Generalized backend pagination eligibility beyond JSON-only flows to support backend/jq-backend URL queries for JSON, GraphQL, CSV, TSV, XML, and HTML (cursor mode remains JSON/GraphQL).
  • Hardened pagination execution:
    • Added per-page retry behavior (2 retries per page).
    • Fixed cursor loop boundary behavior.
    • Fail the whole query when a page exhausts retries.
  • Fixed parser defaults so pagination defaults are applied for both backend and jq-backend.
  • Enabled pagination editor UI for eligible backend URL query types, including GraphQL.
  • Fixed GraphQL replace-mode cursor behavior:
    • First page replaces quoted ${__pagination.cursor} with null.
    • Stops pagination when hasNextPage=false when available with endCursor path.
  • Added a changeset for release notes.
  • Added concise inline comments in remote.go for non-obvious pagination behavior and test descriptions in pagination_test.go.

Tests

  • go test ./pkg/...
  • go test ./pkg/infinity ./pkg/models
  • yarn test:ci src/editors/query/infinityQuery.test.tsx
  • Added/updated focused coverage in:
    • pkg/infinity/remote_test.go
    • pkg/infinity/pagination_test.go
    • pkg/models/query_test.go
    • src/editors/query/infinityQuery.test.tsx

Notes for reviewers

The key review surface is pkg/infinity/remote.go cursor flow, especially first-page replace handling and stop conditions using both endCursor and hasNextPage semantics.

yesoreyeram and others added 6 commits June 12, 2026 12:20
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant