I think the intended concept is to have a similar experience to using blank nodes in Dgraph in the add mutation. The OP does not want to use custom IDs but rather use Dgraph’s IDs but just have a way to define links between them in a single addMutation. To expand on the example for better proof of concept lets say we wanted to create these new people as friends:
Or <-> Michal
Or <-> Justin
Or <-> Elior
Michal <-> Justin
This becomes complicated with a single mutation because you have to stop and think of where to begin the mutation from and how to nest everything listing each item only once to make the desired links. There is actually no way to nest the above making the desired links in a single addMutation without listing at least one of the Persons twice. Here is different ways I tried to arrange them:
Or.friends: [
Michal.friends: [
Justin
]
Justin # listed 2x
Elior
]
Justin.friends: [
Or.friends: [
Elior
Michal
]
Michal # listed 2x
]
Michal.friends: [
Justin
Or.friends: [
Elior
Justin # listed 2x
]
]
Elior.friends: [
Or.friends: [
Michal.friends: [
Justin
]
Justin # listed 2x
]
]
It is just impossible to do in a single mutation without blank nodes (not currently capable) or xids (not wanted, need to have capability of multiple people with the name Justin for example, and don’t want to generate unique UIDs across every UI).
How can we use the update mutation if none of the data we are adding already exists? What we would have to do: Add the people in a addMutation and then capture the ids, link the ids back to the created people, and make a second trip with a updateMutation to create the links. a good graphDB API (added API, because Dgraph supports it, just the generated graphql endpoint does not), should be able to support this without separating the logic into two round trips.
My personal experience hit this road block very early on. Understanding it as just a limitation of the graphql endpoint, I discovered early how to use DQL to insert data using blank nodes. If this was capable to use blank nodes with the graphql endpoint, it would help me as well.
I want to enable users to import data. Some of these imports will contain deep nested relationships like this illustration. I will have to open some DQL, RDF door to do these imports. This could lead to other issues where now in order to make the nested relationships I loose the functionality of the hasInverse logic in the API layer and must manually create the RDF for all of the reverse edges.
Does this help clear up what the OP is wanting and how it could be useful?