graphql icon indicating copy to clipboard operation
graphql copied to clipboard

null values in input are missing in ResolveParams.Args

Open Youngbae-Jeon opened this issue 2 years ago • 0 comments

When I request a mutation to my graphql server(using graphql-go) with null values in input arguments, the null values are missing in ResolveParams.Args

mutation Update($id: Int!, $input: UpdateInput!) {
    update(id=$id, input=$input)
}

with variable...

{
    id: 123,
    input: {
        title: "TITLE"
        description: null
    }
}

Property 'description' does not come into mutation resolver function

// Resolver for mutation update
func ResolveUpdate(p graphql.ResolveParams) (any, error) {
    fmt.Println("*** Args:", p.Args)
    // -> *** Args: map[id:123 input:map[title:TITLE]]
}

I want to distinguish 'description' property between value as null case and missing case

PS. When I write graphql server with graphql-js (javascript version of graphql library), null values comes into the resolver implementation function normally.

Youngbae-Jeon avatar Apr 28 '22 10:04 Youngbae-Jeon