lrstanley / entrest

Extension that generates a compliant OpenAPI spec and server implementation
https://lrstanley.github.io/entrest/
MIT License
6 stars 0 forks source link

feat: support custom sorting (edge terms) #33

Open lrstanley opened 4 weeks ago

lrstanley commented 4 weeks ago

Annotation or similar that would allow passing in a name, along with options ...pet.OrderOption, where the options could look like:

user.ByPosts(
    sql.OrderBySum(post.FieldNumLikes),
    sql.OrderBySum(post.FieldNumViews),
)

The above example would sum post likes + views, effectively "by popularity".

Ref: https://entgo.io/docs/paging#custom-edge-terms