This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Add section about pagination to GraphQL guide#45612
Merged
Merged
Conversation
7 tasks
eseliger
approved these changes
Dec 14, 2022
mrnugget
approved these changes
Dec 14, 2022
|
|
||
| For our GraphQL API we follow the [Relay-style connection spec](https://relay.dev/graphql/connections.htm) and cursor-based pagination. | ||
|
|
||
| **Cursor-based pagination** refers to a pagination API that _does not know about relative page numbers_. Instead, every API response contains a opaque _cursor_ that we can use to load the next or previous page of data. It's important that for the front-end, this _cursor_ is never introspected. It is handled as a generic `string` that is just passed from the API response directly into the next API request. |
Contributor
There was a problem hiding this comment.
It would be cool to have a GraphQL snippet here that shows an example connection with this pagination.
Contributor
Author
There was a problem hiding this comment.
Agreed, but I wanted this snipped to be from the real app and we did not migrate the first resource just yet. Will update this as soon as we have and also add the implementation as an example for a migration 👍
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
First attempt to codify some of the pagination changes in our docs.
We'll want to add a good example implementation as well later.
Thoughts? Anything that we should add?
Test plan
docs change