"wrong use of var()" error when query variable is empty

This is a bug. We added new logic to handle queries with null values, and that error you are seeing is obsolete now, it was from the previous logic.

Basically, Dgraph knows that the aggregate value itemAmount is not set (no uids match) so it will use a default value, in this case of zero, and continue on with the query.

2 Likes