What is are the predicates in your exaple above? Are they something like this?:
<0x1> <name> “Test” .
<0x1> <externalId> “http://example.com” .
Are you trying to look up <0x1> based on its and then add an edge from new node _:xxx to <0x1>?
If so, you’ll need to call the database first to find the UID (0x1) based on the externalId, then use that query result to build and run a mutation. It used to be possible to query + mutate in one call using “mutation variables”, but as part of a design decision, those went away when transactions were introduced (https://github.com/dgraph-io/dgraph/pull/1631).