Schemer.Node (schemer v0.1.0)
The node of the schema.
resolve
resolve
The resolve_fun of the node.
returns
Returns:
{:ok, value}
Returns a executed value.{:ok, value, resolution}
: The third element will overwrite the current resolution, you can overwrite context and others in this way.{:error, error}
: This will halt resolution immediately.
Link to this section Summary
Link to this section Types
Link to this type
node_type()
@type node_type() :: :root | :normal | :leaf | :leaf_like
Link to this type
resolve_fun()
@type resolve_fun() :: {module(), fun :: atom()} | {module(), fun :: atom(), args :: [term()]} | (Schemer.Execution.node_key() -> Schemer.Resolution.resolver_result()) | (Schemer.Execution.node_key(), Schemer.Execution.t() -> Schemer.Resolution.resolver_result()) | (Schemer.Execution.node_key(), Schemer.Execution.t(), Schemer.Resolution.t() -> Schemer.Resolution.resolver_result())
@type t() :: %Schemer.Node{ name: String.t(), nodes: [t()], resolve: (resolve_fun() | %{required(Schemer.Resolution.resolve_name()) => resolve_fun()}) | nil, type: node_type() }