ash_graphql/lib/resource/query.ex

34 lines
673 B
Elixir
Raw Normal View History

2020-08-14 09:39:59 +12:00
defmodule AshGraphql.Resource.Query do
2020-08-15 02:20:47 +12:00
@moduledoc "Represents a configured query on a resource"
2020-08-14 09:39:59 +12:00
defstruct [:name, :action, :type]
@get_schema [
name: [
type: :atom,
doc: "The name to use for the query.",
default: :get
],
action: [
type: :atom,
doc: "The action to use for the query.",
required: true
]
]
@list_schema [
name: [
type: :atom,
doc: "The name to use for the query.",
default: :list
],
action: [
type: :atom,
doc: "The action to use for the query.",
required: true
]
]
def get_schema, do: @get_schema
def list_schema, do: @list_schema
end