Hey @danielhr I’m not able to reproduce your issue on 21.03 (dgraph cloud). Let’s see if we can track down this issue.
Can you have a look at this sandbox repo: https://github.com/matthewmcneely/dgraph-v23.01-sandbox/tree/issue/sorting-doesnt-work-on-queries-with-cascade-17584
It’d be great if you could spin this up and verify the results that I get (count is correct regardless of sorting). Maybe compare my schema to yours, what’s different? Maybe there’s something in your data that’s different from mine.