graphql-go / graphql-go/graphql

null values in input are missing in ResolveParams.Args

Open
#629 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.1k
Forks
845
PR merge metrics
No merged PRs in 30d

Description

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
```graphql
mutation Update($id: Int!, $input: UpdateInput!) {
update(id=$id, input=$input)
}
```
with variable...
```javascript
{
id: 123,
input: {
title: "TITLE"
description: null
}
}
```
Property 'description' does not come into mutation resolver function
```go
// 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.