absinthe v1.2.0-alpha.1 Absinthe.Phase.Document.Variables
Provided a set of variable values:
- Set the
variables
field on theBlueprint.Document.Operation.t
to the reconciled mapping of variable values, supporting defined default values.
Examples
Given a GraphQL document that looks like:
query Item($id: ID!, $text = String = "Another") {
item(id: $id, category: "Things") {
name
}
}
And this phase configuration:
run(blueprint, %{"id" => "1234"})
``
- The operation's `variables` field would have an `"id"` value set to
`%Blueprint.Input.StringValue{value: "1234"}`
- The operation's `variables` field would have an `"text"` value set to
`%Blueprint.Input.StringValue{value: "Another"}`
run(blueprint, %{}) ``
- The operation’s
variables
field would have an"id"
value set tonil
- The operation’s
variables
field would have an"text"
value set to%Blueprint.Input.StringValue{value: "Another"}
Note that no validation occurs in this phase.
Summary
Functions
Specs
put_error(Blueprint.node_t, Absinthe.Phase.Error.t) :: Blueprint.node_t