View Source Absinthe.Blueprint (absinthe v1.7.10)

Represents the graphql document to be executed.

Please see the code itself for more information on individual blueprint sub modules.

Summary

Functions

Get the currently selected operation.

Append the given field or fields to the given type

Determine whether a flag has been set on a node.

See Absinthe.Blueprint.Transform.postwalk/2.

See Absinthe.Blueprint.Transform.postwalk/3.

See Absinthe.Blueprint.Transform.prewalk/2.

See Absinthe.Blueprint.Transform.prewalk/3.

Add a flag to a node.

Index the types by their name

Update the current operation.

Types

flags_t()

@type flags_t() :: %{required(atom()) => module()}

node_t()

@type node_t() ::
  t()
  | Absinthe.Blueprint.Directive.t()
  | Absinthe.Blueprint.Document.t()
  | Absinthe.Blueprint.Schema.t()
  | Absinthe.Blueprint.Input.t()
  | Absinthe.Blueprint.TypeReference.t()

result_t()

@type result_t() :: %{
  optional(:data) => term(),
  optional(:errors) => [term()],
  optional(:extensions) => term()
}

t()

@type t() :: %Absinthe.Blueprint{
  adapter: nil | Absinthe.Adapter.t(),
  directives: [Absinthe.Blueprint.Schema.DirectiveDefinition.t()],
  errors: [Absinthe.Phase.Error.t()],
  execution: Absinthe.Blueprint.Execution.t(),
  flags: flags_t(),
  fragments: [Absinthe.Blueprint.Document.Fragment.Named.t()],
  initial_phases: [Absinthe.Phase.t()] | {module(), atom(), list()},
  input: nil | Absinthe.Language.Document.t(),
  name: nil | String.t(),
  operations: [Absinthe.Blueprint.Document.Operation.t()],
  prototype_schema: nil | Absinthe.Schema.t(),
  result: result_t(),
  schema: nil | Absinthe.Schema.t(),
  schema_definitions: [Absinthe.Blueprint.Schema.SchemaDefinition.t()],
  source: nil | String.t() | Absinthe.Language.Source.t(),
  telemetry: map()
}

use_t()

@type use_t() ::
  Absinthe.Blueprint.Document.Fragment.Named.Use.t()
  | Absinthe.Blueprint.Input.Variable.Use.t()

Functions

add_field(blueprint, type_def_name, new_field)

current_operation(blueprint)

@spec current_operation(t()) :: nil | Absinthe.Blueprint.Document.Operation.t()

Get the currently selected operation.

extend_fields(blueprint, ext_blueprint)

Append the given field or fields to the given type

find(blueprint, fun)

find_field(map, name)

flagged?(node, flag)

@spec flagged?(node_t(), atom()) :: boolean()

Determine whether a flag has been set on a node.

fragment(blueprint, name)

@spec fragment(t(), String.t()) ::
  nil | Absinthe.Blueprint.Document.Fragment.Named.t()

postwalk(blueprint, fun)

See Absinthe.Blueprint.Transform.postwalk/2.

postwalk(blueprint, acc, fun)

See Absinthe.Blueprint.Transform.postwalk/3.

prewalk(blueprint, fun)

See Absinthe.Blueprint.Transform.prewalk/2.

prewalk(blueprint, acc, fun)

See Absinthe.Blueprint.Transform.prewalk/3.

put_flag(node, flag, mod)

@spec put_flag(node_t(), atom(), module()) :: node_t()

Add a flag to a node.

types_by_name(blueprint)

Index the types by their name

update_current(blueprint, change)

@spec update_current(t(), (Absinthe.Blueprint.Document.Operation.t() ->
                       Absinthe.Blueprint.Document.Operation.t())) :: t()

Update the current operation.