function
AppendChild
AppendChild appends one direct child to a group or array. It snapshots the child and preserves existing parent and child policies. Duplicate or invalid names return the original parent and an error.
Arguments
| Argument | Type | Description |
|---|---|---|
parent | Parent | The parent value. |
child | Node | The child value. |
Returns
The declared result.
(Parent, error)Full signature
func AppendChild[Parent interface {
Node
EditChildren(func(*ChildrenDraft) error) (Parent, error)
}](parent Parent, child Node) (Parent, error)Related types
NodeNode is any field definition that can be placed in Fields. Authors normally create nodes with constructors such as Text, Select, Group, or Array and use their concrete fluent methods before adding them to a field list. The interface is sealed so Ridu can snapshot every supported field safely.
ChildrenDraftChildrenDraft owns a detached slice. Committing snapshots again, so retained drafts cannot mutate published graphs. Structural edits are explicit.