ash_graphql/test/support/resources/subscribable.ex

37 lines
642 B
Elixir
Raw Normal View History

2023-10-28 01:50:51 +13:00
defmodule AshGraphql.Test.Subscribable do
@moduledoc false
use Ash.Resource,
data_layer: Ash.DataLayer.Ets,
extensions: [AshGraphql.Resource]
require Ash.Query
2023-12-08 23:59:32 +13:00
resource do
simple_notifiers([AshGraphql.Resource.Notifier])
end
2023-10-28 01:50:51 +13:00
graphql do
type :subscribable
queries do
get :get_subscribable, :read
end
mutations do
create :create_subscribable, :create
end
end
actions do
defaults([:create, :read, :update, :destroy])
end
attributes do
uuid_primary_key(:id)
attribute(:text, :string)
create_timestamp(:created_at)
update_timestamp(:updated_at)
end
end