Skip to content

Commit

Permalink
fix(array unions): for arrays of embedded types unions when graphql_u…
Browse files Browse the repository at this point in the history
…nnested_unions is used, without it they return empty values
  • Loading branch information
jeremygrant committed Jul 28, 2023
1 parent 9d0a8c4 commit ab18f87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/resource/resource.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3474,6 +3474,9 @@ defmodule AshGraphql.Resource do
end)
end

defp middleware_for_field(resource, field, name, {:array, type}, constraints, api) do
middleware_for_field(resource, field, name, type, constraints, api)
end
defp middleware_for_field(resource, field, name, type, constraints, api) do
if Ash.Type.NewType.new_type?(type) &&
Ash.Type.NewType.subtype_of(type) == Ash.Type.Union &&
Expand Down

0 comments on commit ab18f87

Please sign in to comment.