You essentially need Upserts.
https://dgraph.io/docs/mutations/#upsert-block
https://dgraph.io/docs/mutations/#conditional-upsert
For the Go dgo client, here is how you would do it:
You essentially need Upserts.
https://dgraph.io/docs/mutations/#upsert-block
https://dgraph.io/docs/mutations/#conditional-upsert
For the Go dgo client, here is how you would do it: