ash_graphql/lib/resource/subscription.ex

26 lines
589 B
Elixir
Raw Normal View History

2024-01-05 00:53:59 +13:00
defmodule AshGraphql.Resource.Subscription do
@moduledoc "Represents a configured query on a resource"
defstruct [
:name,
2024-08-06 02:35:00 +12:00
:actions,
2024-02-06 21:24:44 +13:00
:read_action
2024-01-05 00:53:59 +13:00
]
@subscription_schema [
name: [
type: :atom,
doc: "The name to use for the subscription."
],
2024-08-06 02:35:00 +12:00
actions: [
type: {:or, [{:list, :atom}, :atom]},
doc: "The create/update/destroy actions the subsciption should listen to. Defaults to all."
],
read_action: [
type: :atom,
doc: "The read action to use for reading data"
2024-01-05 00:53:59 +13:00
]
]
def schema, do: @subscription_schema
end