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(query): improve unique orderBy error message #515

Merged
merged 3 commits into from
Aug 31, 2019

Conversation

soutot
Copy link
Contributor

@soutot soutot commented Aug 30, 2019

When using the cursor for pagination (before and after) Graphile requires that the orderBy clause must be composed by unique value, either referring the table PK or mixing values that returns a unique result.

Currently when the query fails due to that error the message returned is Cannot use cursors without orderBy, which is misleading, because there might be an orderBy clause passed, but it's not correctly assigned.

This PR uses a validation that already exists in the codebase and throws an error message based on the flag returned from it.

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution; do you think this error message is clearer?

Co-Authored-By: Benjie Gillam <benjie@jemjie.com>
Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

Looks Good To Me; thanks for the contribution!

@benjie benjie merged commit 29d87da into graphile:master Aug 31, 2019
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

2 participants