Ash FrameworkAF
Ash Framework3y ago
6 replies
drumusician

InvalidFilterValue for read action

I have this relatively simple read action, but it keeps on failing with a %Ash.Error.Query.InvalidFilterValue

 read :for_organisation do
  argument(:organisation_id, :integer) do
    allow_nil?(false)
  end

  prepare(fn query, _context ->
    query
    |> Ash.Query.load([:game_meta])
    |> Ash.Query.filter(game_meta.organisation_id == ^arg(:organisation_id))
  end)
end


This is the relationship in game_meta:
  belongs_to(:organisation, McFun.Games.Organisation,
    attribute_type: :integer,
    attribute_writable?: true
  )

Any ideas why this is happening?
Was this page helpful?