I am trying to create a relationship between to nodes in Neo4j using GraphQL. What should the mutation look like?
Schema shows it should look like this.
AddPersonRoll(
from: _PersonInput!
to: _RollInput!
): _AddPersonRollPayload
I tryed
mutation {
AddPersonRoll(
from: {
id: "be91aaca-944d-49f7-b3fd-c89ad454d5ab"
}
to: {
id: "8726255f-b6b6-4299-ba01-95f6d4ef2be7"
}
) {
from {
id
name
}
to {
id
name
}
}
}
And it worked. But when I tried putting var into the query I got
{
"error": "Failed to execute 'fetch' on 'Window': Invalid name"
}
the code is
mutation AddPersonRoll($PersonInput: ID!, $RollInput: ID!){
AddPersonRoll(
from: {
id: $PersonInput
}
to: {
id: $RollInput
}
) {
from {
id
name
}
to {
id
name
}
}
}
{
"PersonInput": "3cc70aca-9e07-4bbd-acb2-92670b4d1b0d",
"RollInput": "8726255f-b6b6-4299-ba01-95f6d4ef2be7"
}