Skip to content

Commit

Permalink
bugfix: Fix check for checking if a field is filterable or not (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenseacat authored Jul 21, 2024
1 parent 36eac7b commit 3e5cf20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/resource/info.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions test/support/resources/tag.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e5cf20

Please sign in to comment.