View Source Absinthe.Blueprint.Execution (absinthe v1.7.5)

Blueprint Execution Data

The %Absinthe.Blueprint.Execution{} struct holds on to the core values that drive a document's execution.

Here's how the execution flow works. Given a document like:

{
  posts {
    title
    author { name }
  }
}

After all the validation happens, and we're actually going to execute this document, an %Execution{} struct is created. This struct is passed to each plugin's before_resolution callback, so that plugins can set initial values in the accumulator or context.

Then the resolution phase walks the document until it hits the posts field. To resolve the posts field, an %Absinthe.Resolution{} struct is created from the %Execution{} struct. This resolution struct powers the normal middleware resolution process. When a field has resolved, the :acc, :context, and :field_cache values within the resolution struct are pulled out and used to update the execution.

Link to this section Summary

Link to this section Types

@type acc() :: map()
@type node_t() ::
  Absinthe.Blueprint.Result.Object
  | Absinthe.Blueprint.Result.List
  | Absinthe.Blueprint.Result.Leaf
@type t() :: %Absinthe.Blueprint.Execution{
  acc: acc(),
  adapter: term(),
  context: term(),
  fields_cache: term(),
  fragments: term(),
  result: nil | Absinthe.Blueprint.Result.Object.t(),
  root_value: term(),
  schema: term(),
  validation_errors: [Absinthe.Phase.Error.t()]
}

Link to this section Functions

Link to this function

get_result(execution, operation)

View Source
Link to this function

update(resolution, result, context, acc)

View Source