Kinda, but it brings me to another related question.
If I start expanding that query for a more real-life situation, and now lets say I am adding two nodes that point to the same “root” node like
Query #1
mutation {
addPage(input: [
{ Id: "level1", Title: "level1", LinksTo: [
{
Id: "root", Title: "root"
}
]},
{ Id: "level2", Title: "level2", LinksTo: [
{
Id: "root", Title: "root"
}
]}
]) {
numUids
page {
Id
}
}
}
The query above works. But if I do a slightly different query (note that my root page is now referenced only by the Id - without the rest of the properties), I still get the duplicated XID error.
Query #2
mutation {
addPage(input: [
{ Id: "level1", Title: "level1", LinksTo: [
{
Id: "root", Title: "root"
}
]},
{ Id: "level2", Title: "level2", LinksTo: [
{
Id: "root"
}
]}
]) {
numUids
page {
Id
}
}
}
So, you’ve shown me that if I use the exact same object, it does not generate a conflict, which is good, but I need to know if there is a way of making this second query work (using just a reference) without repeating the whole object - above we have an example only but you can imagine that in real life cases the objects are gonna be much bigger and avoiding to repeat them every time would be a good thing.
Also, If I have to put the whole object I might have to put some nested objects that could reference to other “pages” in this example and then I could get into some circular dependencies that could be really complicated - if not impossible - to solve.
So… is it possible to make this query #2 work without replicating the whole obj?