Unique Constraint on string

Where is the query? I think you are not using Upsert correctly. You should have a query and also use variables. Maybe you have stepped into the Upsert Directive docs. Which is not the same as Upsert Block. See the examples bellow.

https://dgraph.io/docs/dql/dql-syntax/dql-mutation/#upsert-block

https://dgraph.io/docs/dql/mutations/uid-upsert/