absinthe v1.2.0-beta.0 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 to
`nil`
- 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
Callback implementation for Absinthe.Phase.run/2
.