absinthe v1.3.2 Absinthe.Plugin behaviour

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

Functions

Returns the list of default plugins

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

Types

t()
t() :: module

Functions

defaults()

Returns the list of default plugins.

Callbacks

after_resolution(resolution_acc)
after_resolution(resolution_acc :: Document.Resolution.acc) :: Document.Resolution.acc

callback to do something with the resolution accumulator after resolution.

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

before_resolution(resolution_acc)
before_resolution(resolution_acc :: Document.Resolution.acc) :: Document.Resolution.acc

callback to setup the resolution accumulator prior to resolution.

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

pipeline(next_pipeline, resolution_acc)
pipeline(next_pipeline :: Absinthe.Pipeline.t, resolution_acc :: map) :: 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.