graphql-dotnet / graphql-dotnet/graphql-dotnet

Distinguishing between explicit null and omitted value when object given as input

Open
#3,308 5 comments 0 reactions 0 assignees View on GitHub
nice-to-document
Dominant language
C#
Stars
6k
Forks
945
Avg merge
3d 13h
Merged PRs (30d)
14

Description

Hello,

We are trying to implement mutations that support partial updates, and would like to have objects as input. In our current implementation we distinguish between explicit null and omitted arguments by having an additional parameter `valueSet` per parameter on the incoming object, that is set to true in the object parameters' setter.

Previously, we have utilized `IResolveFieldContext.hasArgument()` and have had individual input arguments. It would have been great for a similar functionality when utilizing objects as input, but we have not found a way to see if parameters belonging to an object are set as input in our mutation by accessing the `IResolveFieldContext`.

My question is therefore if I have missed some functionality that already exists, or if it could be possible to extend GraphQL so it is possible to distinguish between explicit null and when the object's parameters are null due to omitted arguments?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.