Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernard Duggan committed Jun 19, 2018
1 parent 12d5e67 commit 761994b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/absinthe/phase/document/execution/deferred_resolution.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
defmodule Absinthe.Phase.Document.Execution.DeferredResolution do

alias Absinthe.{Blueprint, Phase}
alias Absinthe.Phase.Document.Execution.Resolution
alias Absinthe.Resolution.DeferredField
Expand Down Expand Up @@ -29,9 +28,7 @@ defmodule Absinthe.Phase.Document.Execution.DeferredResolution do

defp do_defers(fields, blueprint, pubsub, topic, pid) do
fields
|> Enum.map(fn f -> Task.async(
fn -> resolve_field(f, blueprint, pubsub, topic) end)
end)
|> Enum.map(fn f -> Task.async(fn -> resolve_field(f, blueprint, pubsub, topic) end) end)
|> Task.yield_many(Application.get_env(:absinthe, :max_defer_time))
|> Enum.map(fn {task, res} ->
# Shutdown the tasks that did not reply nor exit
Expand All @@ -55,7 +52,11 @@ defmodule Absinthe.Phase.Document.Execution.DeferredResolution do

defp perform_deferred_resolution(%DeferredField{} = field) do
Resolution.do_resolve_field(
field.resolution, %{field.exec | deferring: true}, field.source, field.path)
field.resolution,
%{field.exec | deferring: true},
field.source,
field.path
)
end

defp add_path(result, path) do
Expand All @@ -64,7 +65,7 @@ defmodule Absinthe.Phase.Document.Execution.DeferredResolution do

defp make_path(path) do
path
|> Enum.map(&(&1.name))
|> Enum.map(& &1.name)
|> Enum.filter(fn e -> e != nil end)
end

Expand Down

0 comments on commit 761994b

Please sign in to comment.