method
Fields.Edit
Edit applies checked changes to a detached draft and returns a new field list. Use it to refine a reusable graph without rebuilding it. The result is published only when the callback and graph validation succeed; on error, Edit returns an unchanged snapshot of the original fields.
Arguments
| Argument | Type | Description |
|---|---|---|
edit | func(*ChildrenDraft) error | The edit value. |
Returns
The declared result.
(Fields, error)Full signature
func (fields Fields) Edit(edit func(*ChildrenDraft) error) (Fields, error)Related types
FieldsFields is the ordered list assigned to ridu.Collection.Fields, ridu.Global.Fields, or a nested field constructor. Populate it with Nodes from this package's constructors. Ridu snapshots the caller-owned slice during construction, editing, and config resolution.
ChildrenDraftChildrenDraft owns a detached slice. Committing snapshots again, so retained drafts cannot mutate published graphs. Structural edits are explicit.