Class: GraphQL::Api::Resolvers::CommandMutation
- Inherits:
-
Object
- Object
- GraphQL::Api::Resolvers::CommandMutation
- Defined in:
- lib/graphql/api/resolvers/command_mutation.rb
Instance Method Summary collapse
- #call(obj, args, ctx) ⇒ Object
-
#initialize(command, action) ⇒ CommandMutation
constructor
A new instance of CommandMutation.
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 |