It wont work since the val function is not supported on facets
What you actually did
The work around is to do a 2 part job, one to query the data and one to do the mutation, but since dgraph wants to reduce the network trips, I thinks this should be supported
Why that wasn’t great, with examples
It wasn’t great that I had to handle more logic on the app just because the QL doesn’t support the parsing of a function
Maybe we can achieve the goal of both issues changing the syntaxis (have inmmutability and consistency on the edge attributes and the ability to use val)
Doing something like this we can have something that currently works ( val on values of nquad ) and indicate to the parser what specific facet we want to mutate to change only that one and not to mutate the other ones