lrstanley/entrest

feat: support custom sorting (edge terms)

Opened this issue · 0 comments

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