Skip to content

Order by nested entity #361

Open
Open
@olirice

Description

@olirice

Add nested entities to <Entity>OrderBy types

For to-one relationships, this could be order_by: {author: {id: desc}}

query {
  articles (
    order_by: {author: {id: desc}}
  ) {
    id
    ...
    author {
      id
    }
  }
}

and (optionally) for to-many relationships we could filter on aggregates (like count)

query {
  authors (
    order_by: {
      articles_aggregate: {count: desc}
    }
  ) {
    id
    name
    articles_aggregate {
      aggregate{
        count
      }
    }
  }
}
  • example shown in hasura style but would likely vary slightly

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions