Skip to content

Issue with update mutation and alias #122

Closed
@michael-forman

Description

@michael-forman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions