bugfix: Fix check for checking if a field is filterable or not (#198)

This commit is contained in:
Rebecca Le 2024-07-21 23:54:52 +08:00 committed by GitHub
parent 36eac7bc54
commit 3e5cf20023
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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