web-ridge / gqlgen-sqlboiler

This is a plugin for gqlgen to generate converts + filter queries and resolvers for sqlboiler
MIT License
74 stars 13 forks source link

Add option to sort data #27

Closed RichardLindhout closed 3 years ago

RichardLindhout commented 4 years ago

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 commented 4 years ago

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

RichardLindhout commented 3 years ago

https://github.com/graphql/graphql-relay-js/issues/20

RichardLindhout commented 3 years ago

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 commented 3 years ago

Released in v3.0.0