Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelcaterisano committed Jun 11, 2024
1 parent 4a9b879 commit 40f6cc8
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions lib/absinthe/phase/document/execution/resolution.ex
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,19 @@ defmodule Absinthe.Phase.Document.Execution.Resolution do
defp reduce_resolution(%{middleware: []} = res), do: res

defp reduce_resolution(%{middleware: [middleware | remaining_middleware]} = res) do
:telemetry.span [:absinthe, :middleware, :call], %{middleware: middleware, resolution: res}, fn ->
result =
case call_middleware(middleware, %{res | middleware: remaining_middleware}) do
%{state: :suspended} = res -> res
res -> reduce_resolution(res)
end

{result, %{middleware: middleware, resolution: res}}
end
:telemetry.span(
[:absinthe, :middleware, :call],
%{middleware: middleware, resolution: res},
fn ->
result =
case call_middleware(middleware, %{res | middleware: remaining_middleware}) do
%{state: :suspended} = res -> res
res -> reduce_resolution(res)
end

{result, %{middleware: middleware, resolution: res}}
end
)
end

defp call_middleware({{mod, fun}, opts}, res) do
Expand Down

0 comments on commit 40f6cc8

Please sign in to comment.