Skip to main content

Module field_update

Module field_update 

Source
Expand description

Three-state wrapper for nullable input fields.

GraphQL distinguishes between an omitted field (“don’t change this”) and an explicit null (“clear this field”). Option<T> + skip_serializing_if can only express the first. MaybeUndefined<T> carries both, so generated input types can drive the Linear API faithfully without hand-rolled JSON patches on the consumer side.

Codegen emits nullable input fields as:

#[serde(default, skip_serializing_if = "MaybeUndefined::is_undefined")]
pub lead_id: MaybeUndefined<String>,

Consumers choose one of:

IntentValueWire form
Leave unchangedMaybeUndefined::Undefinedfield omitted
Clear on the serverMaybeUndefined::Null"field": null
Set to a valueMaybeUndefined::Value(v)"field": v

Enums§

MaybeUndefined
A three-state field value: undefined (omitted), null (explicit clear), or a concrete value.