Skip to content

Commit

Permalink
correct logic
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryseed committed Dec 7, 2019
1 parent 384b4b1 commit 87f1cdf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/absinthe/phase/document/execution/resolution.ex
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ defmodule Absinthe.Phase.Document.Execution.Resolution do
_ -> nil
end

errors = maybe_add_non_null_error(errors, full_type)
errors = maybe_add_non_null_error(errors, value, full_type)

value
|> to_result(bp_field, full_type, extensions)
Expand All @@ -281,11 +281,11 @@ defmodule Absinthe.Phase.Document.Execution.Resolution do
|> propagate_null_trimming
end

defp maybe_add_non_null_error([], %Type.NonNull{}) do
defp maybe_add_non_null_error([], nil, %Type.NonNull{}) do
["Cannot return null for non-nullable field"]
end

defp maybe_add_non_null_error(errors, _) do
defp maybe_add_non_null_error(errors, _, _) do
errors
end

Expand Down

0 comments on commit 87f1cdf

Please sign in to comment.