In the official documentation, here, it is presented an example of updating two nodes relationship by an edge using GraphQL mutation.
The mutation used is:
mutation updateAuthorWithExistingPost($patch: UpdateAuthorInput!) {
updateAuthor(input: $patch) {
...
}
}
with the variables:
{ "patch":
{ "filter": {
"id": ["0x123"]
},
"set": {
"posts": [
{
"postID": "0x456"
}
]
}
}
}
What I’m wondering is, without knowing the author’s UID, one could use the filter: "filter": {"name": {"eq": "some_author_name"}}
, to reference the right author.
But what about the post? Where one would put the filter to reference the post without knowing its UID? Is it possible to create the edge with one single query-mutation with GraphQL? Or is this the situation where DQL comes into play?