I Want to Do
Implement an advanced sorting where parents are sorted by nested children
What I Did
Figured out it is impossible currently…
What I need to Do
I need to learn how sorting is done underneath the DQL language. Find the limitations to it and think of a way to resolve around it. We can’t do better sorting in GraphQL unless it is possible in DQL without breaking the overfetching principal.
SQL can sort results based upon joined tables. I am not sure how this happens actually either without first joining all results which would be equivalent to Dgraph traversing all the edges from a type.
Need to sort by counts
Need to sort by one to one relationships
Want to sort by one to many relationships
We use GraphQL too so our sort should in the end respect rules, but before we worry about that the sort needs to be possible in DQL