mirror of
https://github.com/ash-project/ash_graphql.git
synced 2024-09-20 13:24:14 +12:00
32 lines
813 B
Elixir
32 lines
813 B
Elixir
defmodule AshGraphql.Resource.Subscription do
|
|
@moduledoc "Represents a configured query on a resource"
|
|
defstruct [
|
|
:name,
|
|
:actions,
|
|
:read_action,
|
|
:actor
|
|
]
|
|
|
|
@subscription_schema [
|
|
name: [
|
|
type: :atom,
|
|
doc: "The name to use for the subscription."
|
|
],
|
|
actor: [
|
|
type:
|
|
{:spark_function_behaviour, AshGraphql.Resource.Subscription.Actor,
|
|
{AshGraphql.Resource.Subscription.Actor, 1}},
|
|
doc: "The actor to use for authorization."
|
|
],
|
|
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"
|
|
]
|
|
]
|
|
|
|
def schema, do: @subscription_schema
|
|
end
|