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

Sorting by child entities #3737

Closed
azf20 opened this issue Jul 14, 2022 · 0 comments · Fixed by #3096
Closed

Sorting by child entities #3737

azf20 opened this issue Jul 14, 2022 · 0 comments · Fixed by #3096
Assignees

Comments

@azf20
Copy link
Contributor

azf20 commented Jul 14, 2022

#2960 implemented filtering on the basis of child entities. This introduces sorting on the same entities.

There are some constraints:

  • Sorting should only apply for 1:1 child entities
  • Sorting should only apply to single fields on those child entities
  • This should only be available one level deep

i.e. on the following:

type Country @entity {
  id: ID!
  capital: City!
  cities: [City!]!
}

type City @entity {
  id: ID!
  name: String
  population: Int
  landmarks: [String!]!
}

You should be able to sort Countries by data on the capital entity, but not on the cities. And on the capital, you should be able to sort on the basis of the name and population, but not by the landmarks.

The above should still work with derived 1:1 child entities & fields, and interfaces.

@dotansimha dotansimha linked a pull request Jul 14, 2022 that will close this issue
9 tasks
@dotansimha dotansimha moved this from Todo to In review in GraphQL API Aug 25, 2022
@github-project-automation github-project-automation bot moved this from In review to Done in GraphQL API Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants