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

Order by nested entity #361

Open
olirice opened this issue May 29, 2023 · 2 comments
Open

Order by nested entity #361

olirice opened this issue May 29, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@olirice
Copy link
Contributor

olirice commented May 29, 2023

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
@olirice olirice added the enhancement New feature or request label May 29, 2023
@olirice olirice self-assigned this May 29, 2023
@moarwick
Copy link

Hello @olirice, just a gentle nudge... our app is still in dev but this feature is becoming a bit of a blocker. might you have an ETA? 🙏

@olirice
Copy link
Contributor Author

olirice commented Jul 19, 2023

unfortunately we can't commit to an ETA

we're actively interviewing for another rust dev which will speed up feature development on pg_graphql

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

No branches or pull requests

2 participants