Absinthe.Schema.Prototype (absinthe v1.6.0) 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.

  # More directives...

Then, set it as the prototype for your schema:

defmodule MyAppWeb.Schema do
  use Absinthe.Schema

  @prototype_schema MyAppWeb.SchemaPrototype

  # Use `import_sdl`, etc...

Link to this section Summary


Add a deprecation (with an optional reason) to a node.

Link to this section Functions

Link to this function

expand_deprecate(arguments, node)

View Source


  arguments :: %{optional(:reason) => String.t()},
  node :: Absinthe.Blueprint.node_t()
) :: Absinthe.Blueprint.node_t()

Add a deprecation (with an optional reason) to a node.