absinthe v1.2.0-beta.0 Absinthe.Phase.Document.Variables

Provided a set of variable values:

  • Set the variables field on the Blueprint.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

any_invalid?(nodes)
do_run(input, map)
flag_invalid(node)
flag_invalid(Blueprint.node_t) :: Blueprint.node_t
flag_invalid(node, flag)
flag_invalid(Blueprint.node_t, atom) :: Blueprint.node_t
inherit_invalid(node, children, add_flag)
put_error(node, error)
put_error(Blueprint.node_t, Absinthe.Phase.Error.t) :: Blueprint.node_t
put_flag(node, flag)
run(input, options \\ [])

Callback implementation for Absinthe.Phase.run/2.