Absinthe.Schema.Prototype (absinthe v1.5.4) View Source
Provides the directives available for SDL schema definitions.
By default, the only directive provided is @deprecated
, which supports
a reason
argument (of GraphQL type String
). This can be used to
mark a field
To add additional schema directives, define your own prototype schema, e.g.:
defmodule MyAppWeb.SchemaPrototype do
use Absinthe.Schema.Prototype
directive :feature do
arg :name, non_null(:string)
on [:interface]
# Define `expand`, etc.
end
# More directives...
end
Then, set it as the prototype for your schema:
defmodule MyAppWeb.Schema do
use Absinthe.Schema
@prototype_schema MyAppWeb.SchemaPrototype
# Use `import_sdl`, etc...
end
Link to this section Summary
Functions
Add a deprecation (with an optional reason) to a node.
Link to this section Functions
Specs
expand_deprecate( arguments :: %{optional(:reason) => String.t()}, node :: Absinthe.Blueprint.node_t() ) :: Absinthe.Blueprint.node_t()
Add a deprecation (with an optional reason) to a node.