Skip to content

feat: support nested pagination arguments in relay pagination#3795

Open
jtomaszewski wants to merge 1 commit intourql-graphql:mainfrom
fullstackhouse:feat/relay-pagination-nested-args
Open

feat: support nested pagination arguments in relay pagination#3795
jtomaszewski wants to merge 1 commit intourql-graphql:mainfrom
fullstackhouse:feat/relay-pagination-nested-args

Conversation

@jtomaszewski
Copy link
Copy Markdown
Contributor

Our GraphQL server library ( https://doug-martin.github.io/nestjs-query/docs/graphql/paging/#relation-connections ) uses slightly different format for pagination args: instead of items(first: 2, after: "xyz"), we do items(paging: { first: 2, after: "xyz" }).

Currently relayPagination utility allows only for args to be set at the top-level.

Could we extend it to fit more use cases? In this PR, I'm keeping the exitsing behaviour, but also make it work with pagination args placed under the paging., pagination. or page. object.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 4, 2025

🦋 Changeset detected

Latest commit: dec3cd1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@urql/exchange-graphcache Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

- Add extractPaginationArgs function to handle nested pagination args
- Update compareArgs to areNonPaginationArgsEqual for better arg filtering
- Support common nested patterns: paging, pagination, page
- Add comprehensive test for nested pagination functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jtomaszewski jtomaszewski force-pushed the feat/relay-pagination-nested-args branch from 615df04 to dec3cd1 Compare July 4, 2025 09:02
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