View Source Absinthe.Schema.Prototype (absinthe v1.7.8)

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

Summary

Functions

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

Functions

Link to this function

expand_deprecate(arguments, node)

View Source
@spec 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.