ash-project / ash_graphql

The extension for building GraphQL APIs with Ash
https://hexdocs.pm/ash_graphql
MIT License
71 stars 46 forks source link

Add ability to derive sort inputs for related data. #215

Closed jimsynz closed 4 days ago

jimsynz commented 4 days ago

Describe the solution you'd like

In the example that Author has many Post I might want to write a query something like this:

query {
  authors {
    name
    results {
      posts(sort: [field: "NAME", order: "ASC"]) {
        name
      }
    }
  }
}

ie I'd like to be able to sort relationships as they're loaded.

Describe alternatives you've considered

We're currently using an action argument that is passed to Ash.Query.sort_input.

zachdaniel commented 4 days ago

This is already supported :)