Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Youngbae-Jeon opened this issue Apr 28, 2022 · 0 comments
Open

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

Youngbae-Jeon opened this issue Apr 28, 2022 · 0 comments

Comments

@Youngbae-Jeon
Copy link

Youngbae-Jeon commented Apr 28, 2022

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 Youngbae-Jeon changed the title null values in input are omitted in ResolveParams.Args null values in input are missing in ResolveParams.Args Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant