defmodule Marketplace.Markets.Property.Image do
use Ash.Resource,
data_layer: :embedded,
extensions: [AshGraphql.Resource]
code_interface do
define_for Marketplace.Markets
define :new
end
actions do
create :new, primary?: true
end
attributes do
attribute :uuid, :uuid, allow_nil?: false
attribute :category, :atom do
constraints one_of: [:bedroom, :bathroom]
end
attribute :description, :string
end
graphql do
type :image
end
end
defmodule Marketplace.Markets.Property.Image do
use Ash.Resource,
data_layer: :embedded,
extensions: [AshGraphql.Resource]
code_interface do
define_for Marketplace.Markets
define :new
end
actions do
create :new, primary?: true
end
attributes do
attribute :uuid, :uuid, allow_nil?: false
attribute :category, :atom do
constraints one_of: [:bedroom, :bathroom]
end
attribute :description, :string
end
graphql do
type :image
end
end