absinthe v1.4.0-beta.1 Absinthe.Pipeline View Source

Execute a pipeline of phases.

A pipeline is merely a list of phases. This module contains functions for building, modifying, and executing pipelines of phases.

Link to this section Summary

Functions

Return the part of a pipeline before a specific phase

Return the part of a pipeline after (and including) a specific phase

Replace a phase in a pipeline with another, supporting reusing the same options

Return the part of a pipeline up to and including a specific phase

Link to this section Types

Link to this section Functions

Link to this function before(pipeline, phase) View Source
before(t, atom) :: t

Return the part of a pipeline before a specific phase.

Link to this function for_document(schema, options \\ []) View Source
for_document(Absinthe.Schema.t, Keyword.t) :: t
Link to this function for_schema(prototype_schema, options \\ []) View Source
for_schema(nil | Absinthe.Schema.t, Keyword.t) :: t
Link to this function from(pipeline, phase) View Source
from(t, atom) :: t

Return the part of a pipeline after (and including) a specific phase.

Link to this function insert_after(pipeline, phase, additional) View Source
Link to this function insert_before(pipeline, phase, additional) View Source
Link to this function reject(pipeline, pattern) View Source
reject(t, Regex.t) :: t
Link to this function replace(pipeline, phase, replacement) View Source

Replace a phase in a pipeline with another, supporting reusing the same options.

Examples

Replace a simple phase (without options):

iex> Pipeline.replace([A, B, C], B, X)
[A, X, C]

Replace a phase with options, retaining them:

iex> Pipeline.replace([A, {B, [name: "Thing]}, C], B, X)
[A, {X, [name: "Thing"]}, C]

Replace a phase with options, overriding them:

iex> Pipeline.replace([A, {B, [name: "Thing]}, C], B, {X, [name: "Nope"]})
[A, {X, [name: "Nope"]}, C]
Link to this function run(input, pipeline) View Source
run(data_t, t) ::
  {:ok, data_t, [Absinthe.Phase.t]} |
  {:error, String.t, [Absinthe.Phase.t]}
Link to this function run_phase(pipeline, input, done \\ []) View Source
run_phase(t, data_t, [Absinthe.Phase.t]) ::
  {:ok, data_t, [Absinthe.Phase.t]} |
  {:error, String.t, [Absinthe.Phase.t]}
Link to this function upto(pipeline, phase) View Source
upto(t, atom) :: t

Return the part of a pipeline up to and including a specific phase.

Link to this function without(pipeline, phase) View Source
without(t, Absinthe.Phase.t) :: t