improvement: handle nil parent

This commit is contained in:
Zach Daniel 2023-12-05 12:46:38 -05:00
parent 896d5c8df3
commit e16592f592

View file

@ -2442,6 +2442,13 @@ defmodule AshGraphql.Graphql.Resolver do
end
end
def resolve_attribute(
%{source: nil} = resolution,
_
) do
Absinthe.Resolution.put_result(resolution, {:ok, nil})
end
defp resolve_union_result(value, data) when is_list(value) do
Enum.map(value, &resolve_union_result(&1, data))
end