absinthe v1.2.6 Absinthe.Type.Argument

Used to define an argument.

Usually these are defined using Absinthe.Schema.Notation.arg/2

Summary

Types

t()

Argument configuration

Functions

Build an AST of the args map for inclusion in other types

Types

t()
t :: %{name: binary, type: Absinthe.Type.identifier_t, default_value: any, deprecation: Absinthe.Type.Deprecation.t | nil, description: binary | nil, __reference__: Absinthe.Type.Reference.t}

Argument configuration

  • :name - The name of the argument, usually assigned automatically using Absinthe.Schema.Notation.arg/2.
  • :type - The type values the argument accepts/will coerce to.
  • :deprecation - Deprecation information for an argument, usually set-up using Absinthe.Schema.Notation.deprecate/1.
  • :description - Description of an argument, useful for introspection.

Functions

build(args)

Build an AST of the args map for inclusion in other types

Examples

iex> build([foo: [type: :string], bar: [type: :integer]])
{:%{}, [],
 [foo: {:%, [],
  [{:__aliases__, [alias: false], [:Absinthe, :Type, :Argument]},
   {:%{}, [], [name: "foo", type: :string]}]},
  bar: {:%, [],
 [{:__aliases__, [alias: false], [:Absinthe, :Type, :Argument]},
  {:%{}, [], [name: "bar", type: :integer]}]}]}
fetch(container, key)