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

Handling ordering in GraphQL connections #571

Closed
msprunck opened this issue Jun 12, 2017 · 0 comments
Closed

Handling ordering in GraphQL connections #571

msprunck opened this issue Jun 12, 2017 · 0 comments
Assignees

Comments

@msprunck
Copy link
Contributor

All nodes in connection are currently sorted by ID in ascending order.

A connection should provide a new argument to specify the ordering.

As suggested here we could add an orderBy argument that take [Ordering]! where ordering is an InputObject:

input Ordering {
  sort: Sort!
  direction: Direction! = ASC
}

enum Sort { VALID_TIME_START_TIME, VALID_TIME_END_TIME , DISPOSITION }
enum Direction { ASC, DESC }

You'd then do:

{
  judgements(orderBy: [{sort: VALID_TIME_END_TIME, direction: DESC}, 
                       {sort: DISPOSITION, direction: ASC}, 
                       {sort: VALID_TIME_START_TIME, direction: DESC}])
}
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

No branches or pull requests

2 participants