Null Value
NullValue:
null
Null values are represented as the keyword null.
GraphQL has two semantically different ways to represent the lack of a value:
- Explicitly providing the literal value: null .
- Implicitly not providing a value at all.
For example, these two field calls are similar, but are not identical:
{
field(arg: null)
field
}
The first has explictly providednullto the argument “arg”, while the second has implicitly not provided a value to the argument “arg”. These two forms may be interpreted differently. For example, a mutation representing deleting a field vs not altering a field, respectively. Neither form may be used for an input expecting a Non‐Null type.
The same two methods of representing the lack of a value are possible via variables by either providing the a variable value as null and not providing a variable value at all.