From 2a4a27dcf05cd8c3dd0fc3e53f7fc551b21cb104 Mon Sep 17 00:00:00 2001 From: Barnabas Jovanovics Date: Thu, 8 Feb 2024 13:44:40 +0100 Subject: [PATCH] handle cases where the type has no short name --- lib/resource/resource.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/resource/resource.ex b/lib/resource/resource.ex index 446e460a..92dc6237 100644 --- a/lib/resource/resource.ex +++ b/lib/resource/resource.ex @@ -2224,7 +2224,11 @@ defmodule AshGraphql.Resource do defp do_get_expressable_types(operator_types, field_type, array_type?) do field_type_short_name = - Ash.Type.short_names() |> Enum.find(fn {_, type} -> type == field_type end) |> elem(0) + case Ash.Type.short_names() + |> Enum.find(fn {_, type} -> type == field_type end) do + nil -> nil + {short_name, _} -> short_name + end operator_types |> Enum.filter(fn @@ -2243,7 +2247,7 @@ defmodule AshGraphql.Resource do [:any, type] when is_atom(type) -> true - [^field_type_short_name, type] when is_atom(type) -> + [^field_type_short_name, type] when is_atom(type) and not is_nil(field_type_short_name) -> true _ ->