Skip to content

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

@Youngbae-Jeon

Description

@Youngbae-Jeon

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.

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