type
NonNullInput
A write-only generated mutation value that refuses to encode JSON null.
Properties
| Property | Type | Description |
|---|---|---|
MarshalJSON() | ([]byte, | Encode the concrete value, or fail when it encodes as JSON null. |
How it works
Generated non-null slice, map, fallback json.RawMessage, and plugin-owned named mutation fields use this wrapper because the manifest does not fully describe their JSON nullability.
A required field uses a NonNullInput value constructed by NonNull. A defaulted or update field uses *NonNullInput: nil omits the key and SetNonNull supplies a present value.
Get inspects a concrete value. Generated field codecs preserve explicit nullable values when decoding; non-null wrappers reject JSON null.
Full signature
type NonNullInput[T any] struct {
// contains filtered or unexported fields
}Methods
NonNullInput.MarshalJSON()MarshalJSON implements json.Marshaler and rejects an encoded JSON null.
NonNullInput.Get()Get returns the supplied value, or the zero value and false for an omitted input. Encoding still validates that the value does not encode as JSON null.
NonNullInput.UnmarshalJSON()UnmarshalJSON rejects null for a non-null mutation value.