feat!: check Django model has a default ordering when used in a Relay Connection#1495
Merged
firaskafri merged 1 commit intoJan 30, 2024
Conversation
tcleonard
force-pushed
the
feat/add-connection-ordering-check
branch
2 times, most recently
from
January 29, 2024 21:29
5ef1650 to
da6ed02
Compare
tcleonard
force-pushed
the
feat/add-connection-ordering-check
branch
from
January 29, 2024 22:36
da6ed02 to
d12ea31
Compare
superlevure
approved these changes
Jan 30, 2024
superlevure
left a comment
Collaborator
There was a problem hiding this comment.
Good catch! Thanks for the PR @tcleonard
firaskafri
approved these changes
Jan 30, 2024
superlevure
pushed a commit
to loft-orbital/graphene-django
that referenced
this pull request
Jan 30, 2024
… connection (graphql-python#1495) Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
superlevure
added a commit
to loft-orbital/graphene-django
that referenced
this pull request
Jun 30, 2026
…sed in a relay connection (graphql-python#1495)
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.
Since predictable ordering is a pre-requisite for a Relay Connection pagination to work, we should enforce it.
Indeed if you don't have a consistent ordering, since the pagination is based on an offset under the hood, when requesting page 2 you wouldn't have guaranteed that it's actually the same order that was used to define page 1.