type

NonNullInput

A write-only generated mutation value that refuses to encode JSON null.

Properties

PropertyTypeDescription
MarshalJSON()([]byte, error)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 }

Source core/input.go:53

Methods