defmodule MyApp.Org do
relationships do
has_many :books, MyApp.Org do
no_attributes? true
filter expr(catalog.org_id == parent(id))
end
end
end
defmodule MyApp.Catalog do
relationships do
belongs_to :org, MyApp.Org
has_many :books, MyApp.Book
end
end
defmodule MyApp.Book do
actions do
read :read do
primary? true
pagination offset?: true, default_limit: 1, required?: false
end
end
relationships do
belongs_to :catalog, MyApp.Catalog
end
end
defmodule MyApp.Org do
relationships do
has_many :books, MyApp.Org do
no_attributes? true
filter expr(catalog.org_id == parent(id))
end
end
end
defmodule MyApp.Catalog do
relationships do
belongs_to :org, MyApp.Org
has_many :books, MyApp.Book
end
end
defmodule MyApp.Book do
actions do
read :read do
primary? true
pagination offset?: true, default_limit: 1, required?: false
end
end
relationships do
belongs_to :catalog, MyApp.Catalog
end
end