absinthe v1.2.0-alpha.1 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)

Specs

flag_invalid(Blueprint.node_t) :: Blueprint.node_t
flag_invalid(node, flag)

Specs

flag_invalid(Blueprint.node_t, atom) :: Blueprint.node_t
inherit_invalid(node, children, add_flag)
put_error(node, error)

Specs

put_error(Blueprint.node_t, Absinthe.Phase.Error.t) :: Blueprint.node_t
put_flag(node, flag)
run(input, options \\ [])