View Source Absinthe.Plugin behaviour (absinthe v1.7.7)

Plugin Behaviour

Plugins are an additional set of callbacks that can be used by module based middleware to run actions before and after resolution, as well as add additional phases to run after resolution

Summary

Callbacks

callback to do something with the resolution accumulator after resolution.

callback to setup the resolution accumulator prior to resolution.

callback used to specify additional phases to run.

Functions

Returns the list of default plugins.

Types

Callbacks

Link to this callback

after_resolution(execution)

View Source
@callback after_resolution(execution :: Absinthe.Blueprint.Execution.t()) ::
  Absinthe.Blueprint.Execution.t()

callback to do something with the resolution accumulator after resolution.

NOTE: This function is given the full accumulator. Namespacing is suggested to avoid conflicts.

Link to this callback

before_resolution(execution)

View Source
@callback before_resolution(execution :: Absinthe.Blueprint.Execution.t()) ::
  Absinthe.Blueprint.Execution.t()

callback to setup the resolution accumulator prior to resolution.

NOTE: This function is given the full accumulator. Namespacing is suggested to avoid conflicts.

Link to this callback

pipeline(next_pipeline, execution)

View Source
@callback pipeline(
  next_pipeline :: Absinthe.Pipeline.t(),
  execution :: Absinthe.Blueprint.Execution.t()
) :: Absinthe.Pipeline.t()

callback used to specify additional phases to run.

Plugins may require additional resolution phases to be run. This function should use values set in the resolution accumulator to determine whether or not additional phases are required.

NOTE: This function is given the whole pipeline to be inserted after the current phase completes.

Functions

Returns the list of default plugins.