diff --git a/lib/absinthe/phoenix/channel.ex b/lib/absinthe/phoenix/channel.ex index 5e32a8b..fb009ea 100644 --- a/lib/absinthe/phoenix/channel.ex +++ b/lib/absinthe/phoenix/channel.ex @@ -117,10 +117,18 @@ defmodule Absinthe.Phoenix.Channel do end end - defp run(document, schema, pipeline, options) do - {module, fun} = pipeline + defp run(document, schema, pipeline_mf, options) do + {module, fun} = pipeline_mf + args = [schema, options] - case Absinthe.Pipeline.run(document, apply(module, fun, [schema, options])) do + blueprint = %Absinthe.Blueprint{input: document, initial_phases: {module, fun, args}} + + pipeline = + module + |> apply(fun, args) + |> Absinthe.Pipeline.without(Absinthe.Phase.Init) + + case Absinthe.Pipeline.run(blueprint, pipeline) do {:ok, %{result: result, execution: res}, _phases} -> {:ok, result, res.context} diff --git a/mix.exs b/mix.exs index 52ccb7b..9cc28c1 100644 --- a/mix.exs +++ b/mix.exs @@ -52,7 +52,7 @@ defmodule Absinthe.Phoenix.Mixfile do defp deps do [ {:absinthe_plug, "~> 1.5"}, - {:absinthe, "~> 1.5"}, + {:absinthe, "~> 1.5", github: "absinthe-graphql/absinthe", branch: "initial-phases-mfa", override: true}, {:decimal, "~> 1.0 or ~> 2.0"}, {:phoenix, "~> 1.5"}, {:phoenix_pubsub, "~> 2.0"}, diff --git a/mix.lock b/mix.lock index 15da763..5e27e37 100644 --- a/mix.lock +++ b/mix.lock @@ -1,5 +1,5 @@ %{ - "absinthe": {:hex, :absinthe, "1.7.5", "a15054f05738e766f7cc7fd352887dfd5e61cec371fb4741cca37c3359ff74ac", [:mix], [{:dataloader, "~> 1.0.0 or ~> 2.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 1.2.2 or ~> 1.3.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:opentelemetry_process_propagator, "~> 0.2.1", [hex: :opentelemetry_process_propagator, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "22a9a38adca26294ad0ee91226168f5d215b401efd770b8a1b8fd9c9b21ec316"}, + "absinthe": {:git, "https://github.com/absinthe-graphql/absinthe.git", "20932b06663d826a0e7627eee866cf190e017211", [branch: "initial-phases-mfa"]}, "absinthe_plug": {:hex, :absinthe_plug, "1.5.8", "38d230641ba9dca8f72f1fed2dfc8abd53b3907d1996363da32434ab6ee5d6ab", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bbb04176647b735828861e7b2705465e53e2cf54ccf5a73ddd1ebd855f996e5a"}, "castore": {:hex, :castore, "1.0.3", "7130ba6d24c8424014194676d608cb989f62ef8039efd50ff4b3f33286d06db8", [:mix], [], "hexpm", "680ab01ef5d15b161ed6a95449fac5c6b8f60055677a8e79acf01b27baa4390b"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},