Does order in a DQL query matter?

So, your problem is exclusive to Recurse query. Without it any order doesnt matter.

Understand that Recurse is a kind of automation. Where it will continue expanding according to the query body (list of predicates) given. So order can influence in this case. And results can be unforeseen for each case. As this is a recursive query, there is no way to predict exactly what will be returned(you have to explore each case). Just that it will keep expanding if there are linked edges.

By the way, Recurse query doesn’t accept nested block. You can only set the main body and it will keep expanding recursively. It doesn’t make sense to set nested in a recursive query. Unless you want to recurse in the nested block. But Dgraph doesn’t support it. You would have to make multiple blocks and each block a recurse.