How to find nodes with a scalar predicate having values found during traversal

Check the answer above.

Dgraph will only return error if there was syntax error or from the server. And not usage error. In my answer above you can see the correct way to use this approach.