Absinthe.Type.InputObject (absinthe v1.6.0) View Source

Defines a GraphQL input object

Input objects enable nested arguments to queries and mutations.

Example

mutation do
  field :user, :user do
    arg :name, :string
    arg :contact, non_null(:contact)

    resolve &User.create/2
  end
end

input_object :contact do
  field :email, :string
end

This supports the following mutation:

mutation CreateUser {
  user(contact: {email: "foo@bar.com"}) {
    id
  }
}

Link to this section Summary

Types

t()

Note new input object types should be defined using Absinthe.Schema.Notation.input_object/3.

Functions

Callback implementation for c:Absinthe.Introspection.TypeKind.kind/0.

Link to this section Types

Specs

t() :: %Absinthe.Type.InputObject{
  __private__: Keyword.t(),
  __reference__: Absinthe.Type.Reference.t(),
  definition: module(),
  description: binary(),
  fields: map(),
  identifier: atom(),
  name: binary()
}

Note new input object types should be defined using Absinthe.Schema.Notation.input_object/3.

The __private__ and :__reference__ fields are for internal use.

Link to this section Functions

Callback implementation for c:Absinthe.Introspection.TypeKind.kind/0.