diff --git a/lib/resource/info.ex b/lib/resource/info.ex index d7a7344..6b298ab 100644 --- a/lib/resource/info.ex +++ b/lib/resource/info.ex @@ -190,9 +190,9 @@ defmodule AshGraphql.Resource.Info do end @doc "May the specified field be filtered on?" - def filterable_field?(resource, field) do + def filterable_field?(resource, field_name) do filterable_fields = AshGraphql.Resource.Info.filterable_fields(resource) - is_nil(filterable_fields) or field.name in filterable_fields + is_nil(filterable_fields) or field_name in filterable_fields end end diff --git a/test/support/resources/tag.ex b/test/support/resources/tag.ex index 9def3ab..09b1e84 100644 --- a/test/support/resources/tag.ex +++ b/test/support/resources/tag.ex @@ -9,6 +9,8 @@ defmodule AshGraphql.Test.Tag do graphql do type(:tag) + filterable_fields [:name] + queries do get :get_tag, :read list :get_tags, :read