Skip to content

feat!: check Django model has a default ordering when used in a Relay Connection#1495

Merged
firaskafri merged 1 commit into
graphql-python:mainfrom
loft-orbital:feat/add-connection-ordering-check
Jan 30, 2024
Merged

feat!: check Django model has a default ordering when used in a Relay Connection#1495
firaskafri merged 1 commit into
graphql-python:mainfrom
loft-orbital:feat/add-connection-ordering-check

Conversation

@tcleonard

Copy link
Copy Markdown
Collaborator

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.

@tcleonard
tcleonard force-pushed the feat/add-connection-ordering-check branch 2 times, most recently from 5ef1650 to da6ed02 Compare January 29, 2024 21:29
@tcleonard
tcleonard force-pushed the feat/add-connection-ordering-check branch from da6ed02 to d12ea31 Compare January 29, 2024 22:36

@superlevure superlevure left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks for the PR @tcleonard

@firaskafri
firaskafri merged commit 96c09ac into graphql-python:main 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>
kiendang added a commit that referenced this pull request Apr 11, 2024
kiendang added a commit that referenced this pull request Apr 18, 2024
* Revert "feat!: check django model has a default ordering when used in a relay connection (#1495)"

This reverts commit 96c09ac.

* Fix assert no warning for pytest>=8
superlevure added a commit to loft-orbital/graphene-django that referenced this pull request Jun 30, 2026
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.

3 participants