function
AsVirtual
AsVirtual provides a checked view of a virtual field whose value type is T.
Arguments
| Argument | Type | Description |
|---|---|---|
node | Node | The node value. |
Returns
The declared result.
(VirtualField[T], error)Full signature
func AsVirtual[T VirtualValue](node Node) (VirtualField[T], error)Related types
VirtualValueVirtualValue is a type a virtual field can compute: text as a string, a number as a float64, a checkbox value as a bool, or any JSON value as a store.Value.
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.
VirtualFieldVirtualField configures a computed response value that cannot be set by a write request. T is the value its resolver and response transforms use.