Thanks @barnabasJ that got me on the right track:
require Ash.Query
read :by_definition do
argument :definition, :map
prepare fn query, _context ->
definition_id = Ash.Query.get_argument(query, :definition).id
Ash.Query.filter(query, definition_id == ^definition_id)
end
end






















