Ordering the results
You might want to sort you result in a specific order. To do that, you need to use the orderBy argument::
query {
Customers(
orderBy: [
{
column: LABEL,
order: ASC,
},
{
column: ID,
order: DESC,
},
]
) {
data {
id
label
}
}
}- column is the field used to order the results. It can be any field available for the entity.
- order decides what order is used for the sorting. ASC (ascending) sort the results from smaller to larger, while DESC (descending) does the opposite)
You can choose to pass only the column argument without a specifying the direction since ASC will be used as default, however the direction always requires to also pass the by and cannot be used by itself.
Each entities has its own columns you can filter on. You will find those column in each entities documentations.
