From d5e8781abf444824aa266b4228b1f7aa6b929f17 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Mon, 31 Jul 2023 22:14:11 -0400 Subject: [PATCH] fix: recurse through array types for union checking --- lib/ash_graphql.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ash_graphql.ex b/lib/ash_graphql.ex index 28df051d..45befc87 100644 --- a/lib/ash_graphql.ex +++ b/lib/ash_graphql.ex @@ -297,6 +297,10 @@ defmodule AshGraphql do end end + defp nested_attrs({:array, type}, constraints, already_checked) do + nested_attrs(type, constraints[:items] || [], already_checked) + end + defp nested_attrs(Ash.Type.Union, constraints, already_checked) do Enum.reduce( constraints[:types] || [],