-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: rename startCursor and endCursor to before and after #148
Merged
Conversation
This file contains 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
After chatting with @alanshaw I did a quick survey of naming conventions for bidirectional paging. After reviewing the following: - https://theburningmonk.com/2018/02/guys-were-doing-pagination-wrong/ - before/after - https://gist.github.com/tspecht/f4b53e34a2ccf1bdef2c8fb9a475ca05 - startCursor/endCursor - https://medium.com/hackernoon/bi-directional-cursor-pagination-with-react-js-relay-and-graphql-dc4ad6f9cbb0 before/after - https://www.apollographql.com/docs/react/pagination/cursor-based/#relay-style-cursor-pagination before/after - relay's official paging spec uses before/after - https://relay.dev/graphql/connections.htm I proposed renaming `startCursor` and `endCursor` to `before` and` after` and de-deprecating cursor. This exposes a paging API that should feel ergonomic to developers expecting a single directional paging API (which typically uses `cursor` and developers expecting a bidirectional paging API - `startCursor` and `endCursor` are definitely used for bidirectional paging, but, eg Relay seems to have moved to `before` and `after` away from `startCursor` and `endCursor`. `before` and `after` also have the benefit of being more succinct.
travis
added a commit
to storacha/w3cli
that referenced
this pull request
Feb 22, 2023
Per the change in storacha/w3infra#148
travis
added a commit
to storacha/w3up
that referenced
this pull request
Feb 22, 2023
Per the reasoning and change in storacha/w3infra#148
View stack outputs
|
travis
added a commit
to storacha/w3ui
that referenced
this pull request
Feb 22, 2023
per change in storacha/w3infra#148
alanshaw
approved these changes
Feb 22, 2023
vasco-santos
approved these changes
Feb 22, 2023
travis
added a commit
to storacha/w3up
that referenced
this pull request
Feb 23, 2023
Per the reasoning and change in storacha/w3infra#148
gobengo
pushed a commit
to storacha/w3up
that referenced
this pull request
Apr 11, 2023
Per the reasoning and change in storacha/w3infra#148
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.
After chatting with @alanshaw I did a quick survey of naming conventions for bidirectional paging. After reviewing the following:
I proposed renaming
startCursor
andendCursor
tobefore
andafter
and de-deprecating cursor.This results in a paging API that should feel ergonomic to developers expecting a single directional paging API (which typically uses
cursor
) and developers expecting a bidirectional paging API -startCursor
andendCursor
are definitely used for bidirectional paging, but, eg Relay seems to have moved tobefore
andafter
away fromstartCursor
andendCursor
.before
andafter
also have the benefit of being more succinct.