Skip to content
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!: check Django model has a default ordering when used in a Relay Connection #1495

Conversation

tcleonard
Copy link
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
Copy link
Collaborator

@superlevure superlevure left a comment

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
12 checks passed
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
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.

None yet

3 participants