-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Experience Report
Note: Feature requests are judged based on user experience and modeled on Go Experience Reports. These reports should focus on the problems: they should not focus on and need not propose solutions.
What you wanted to do
You can use orderasc to sort by multiple predicates, which will combine their orderings using lexicographic ordering:
{
asdf(func: has(DOB), orderasc: DOB, orderasc: name) {
uid
DOB
name
}
}
It would be nice if we could lexicographically sort by multiple facets in the same way:
{
asdf(func: has(edge)) {
uid
edge @facets(kind, index, orderasc: kind, orderasc: index) {
uid
}
}
}
What you actually did
Sort by one facet, and then sort by the other on the client side, or leave unsorted and handle all sorting client-side.
Why that wasn't great, with examples
In complex, deeply nested queries, it can be cumbersome to post-process results. It divides the intended query into two steps: the actual query, and then a sorting phase. This is trickier to maintain. Besides, graphql(+-) already lends itself nicely to things such as sorting.