Thanks for pointing that out. We have noted this issue.
As a workaround, you may carry out an upsert by running a query and mutation separately. There is an example of this in tryUpsert function of dgraph-js-http/acctUpsert.spec.ts at master · dgraph-io/dgraph-js-http · GitHub