Sorting query results
You can sort the query results on one or more fields. If you have multiple fields to sort on, you must enclose them in an array and set the sorting order by rearranging the array elements. For each sorting field you must specify the order direction:
- Ascending:
asc
. - Descending:
desc
.
To retrieve a list of assets ordered by their full names in ascending order use the following query:
query {
assets(order: {fullName: asc} ) {
fullName
}
}
To retrieve a list of assets ordered first by the parent domain name and then by the asset full name use the following query:
query {
assets(order: [ {domain: {name: asc}}, {fullName: desc} ]) {
domain {
name
}
fullName
}
}
If you don't provide any order field, the entities are sorted in ascending order of their IDs.