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

Add option to sort data #27

Closed
RichardLindhout opened this issue May 19, 2020 · 4 comments
Closed

Add option to sort data #27

RichardLindhout opened this issue May 19, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request In development We are working on this issue

Comments

@RichardLindhout
Copy link
Member

It would be nice to sort on columns maybe even more than 1 if you want it. And would be cool if it was type safe in graphql schema.

sort: {
by: [name]
type: ASC | DESC
}

@RichardLindhout RichardLindhout added the enhancement New feature or request label May 19, 2020
@RichardLindhout RichardLindhout self-assigned this May 19, 2020
@RichardLindhout
Copy link
Member Author

By as an ENUM with all low level available keys of object

@RichardLindhout
Copy link
Member Author

@RichardLindhout
Copy link
Member Author

RichardLindhout commented Oct 22, 2020

This would support all use-cases in a type-safe way :)

input UserOrdering {
  sort: UserSort!
  direction: SortDirection! = ASC
}
enum SortDirection { ASC, DESC }
enum UserSort { FIRST_NAME, LAST_NAME }
{
  users(orderBy: [{sort: FIRST_NAME}, {sort: LAST_NAME}])
}

@RichardLindhout RichardLindhout added the In development We are working on this issue label Oct 22, 2020
RichardLindhout added a commit that referenced this issue Oct 22, 2020
@RichardLindhout
Copy link
Member Author

Released in v3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request In development We are working on this issue
Projects
None yet
Development

No branches or pull requests

1 participant