neo4j-graphql / neo4j-graphql-java

Neo4j Labs Project: Pure JVM translation for GraphQL queries and mutations to Neo4j's Cypher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with update mutation and alias

michael-forman opened this issue · comments

commented

If I have:

type Foo
{
    uuid: ID!
    name: String
}

and an existing Foo node with values for both properties.

applying the mutation:

mutation updateFoo($name: String, $uuid: ID!) {
foo: updateFoo(name: $name, uuid: $uuid) { name uuid }
}

with values:

{
"name":"222",
"uuid":"b763dc6a-114d-4f89-b3aa-bf33a5599a64"
}

(where there uuid is the matching one,

the result is a foo object with the uuid removed.

if instead I run the mutation without the alias it works as expected:

mutation updateFoo($name: String, $uuid: ID!) {
    updateFoo(name: $name, uuid: $uuid) { name uuid }
}

I was trying to use an alias so that my "CRUD" type pages always got the result back in the same format. Not sure if that's appropriate or not...

(The essentially the same query with the GRANDstack works as expected

mutation updateFoo($name: String, $uuid: ID!) {
foo: UpdateFoo(name: $name, uuid: $uuid) { name uuid }

)

Cheers,

Michael

duplicate of #95
relates to #106
resolved by #96

commented

ah, sorry - I should have realised that was the same issue.