graphql-go / graphql

An implementation of GraphQL for Go / Golang
MIT License
9.94k stars 841 forks source link

null values in input are missing in ResolveParams.Args #629

Open Youngbae-Jeon opened 2 years ago

Youngbae-Jeon commented 2 years ago

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.