Class: GraphQL::DefinitionHelpers::DefinedByConfig::DefinitionConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/mutable_type/defined_by_config.rb

Overview

Define MutableType by define block

Instance Method Summary collapse

Instance Method Details

#mutation(&block) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/graphql/mutable_type/defined_by_config.rb', line 5

def mutation(&block)
  mutation_type = mutation_type(&block)

  field :mutation do
    name 'mutation'
    type mutation_type
    description mutation_type.description

    resolve -> (obj, _args, _cxt) { obj }
  end
end