AbsintheConstraints.Directive (absinthe_constraints v0.2.0)

Defines a GraphQL directive to add constraints to field definitions and argument definitions.

Example

input_object :my_input do
  field(:my_field, :integer, directives: [constraints: [min: 1]])
end

#...
object :my_query do
  field :my_field, non_null(:string) do
    arg(:my_arg, non_null(:string), directives: [constraints: [format: "uuid"]])
    resolve(&MyResolver.resolve/2)
  end
end

Summary

Functions

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

Functions

Link to this function

expand_constraints(args, node)

Link to this function

expand_deprecate(arguments, node)

@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.

Link to this function

pipeline(pipeline)