function

AsVirtual

AsVirtual provides a checked view of a virtual field whose value type is T.

Arguments

ArgumentTypeDescription
nodeNodeThe node value.

Returns

The declared result.

(VirtualField[T], error)

Full signature

Related types

  • VirtualValue

    VirtualValue 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.

  • Node

    Node 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.

  • VirtualField

    VirtualField configures a computed response value that cannot be set by a write request. T is the value its resolver and response transforms use.