diff --git a/lib/absinthe/blueprint.ex b/lib/absinthe/blueprint.ex index ff66e5673d..496296a114 100644 --- a/lib/absinthe/blueprint.ex +++ b/lib/absinthe/blueprint.ex @@ -43,7 +43,7 @@ defmodule Absinthe.Blueprint do source: nil | String.t() | Absinthe.Language.Source.t(), execution: Blueprint.Execution.t(), result: result_t, - initial_phases: [Absinthe.Phase.t()] + initial_phases: [Absinthe.Phase.t()] | {module(), atom, list()} } @type result_t :: %{ diff --git a/lib/absinthe/subscription/pipeline_serializer.ex b/lib/absinthe/subscription/pipeline_serializer.ex index a0ba835a81..5f5ad6ad91 100644 --- a/lib/absinthe/subscription/pipeline_serializer.ex +++ b/lib/absinthe/subscription/pipeline_serializer.ex @@ -18,7 +18,12 @@ defmodule Absinthe.Subscription.PipelineSerializer do @type packed_pipeline :: {:packed, [packed_phase_config()], options_map()} - @spec pack(Pipeline.t()) :: packed_pipeline() + @spec pack(Pipeline.t() | {module(), atom, list()}) :: packed_pipeline() + def pack({module, function, args}) + when is_atom(module) and is_atom(function) and is_list(args) do + {module, function, args} + end + def pack(pipeline) do {packed_pipeline, reverse_map} = pipeline @@ -41,6 +46,10 @@ defmodule Absinthe.Subscription.PipelineSerializer do end) end + def unpack({module, function, args}) do + apply(module, function, args) + end + def unpack([_ | _] = pipeline) do pipeline end