Class: GraphQL::Api::Resolvers::CommandMutation

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/api/resolvers/command_mutation.rb

Instance Method Summary collapse

Constructor Details

#initialize(command, action) ⇒ CommandMutation

Returns a new instance of CommandMutation.



5
6
7
8
# File 'lib/graphql/api/resolvers/command_mutation.rb', line 5

def initialize(command, action)
  @command = command
  @action = action
end

Instance Method Details

#call(obj, args, ctx) ⇒ Object



10
11
12
# File 'lib/graphql/api/resolvers/command_mutation.rb', line 10

def call(obj, args, ctx)
  @command.new(args, ctx).send(@action)
end