Class: GraphQL::Api::CommandType
- Inherits:
-
Object
- Object
- GraphQL::Api::CommandType
- Defined in:
- lib/graphql/api/command_type.rb
Instance Attribute Summary collapse
-
#ctx ⇒ Object
Returns the value of attribute ctx.
-
#inputs ⇒ Object
Returns the value of attribute inputs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(inputs, ctx) ⇒ CommandType
constructor
A new instance of CommandType.
- #perform ⇒ Object
Constructor Details
#initialize(inputs, ctx) ⇒ CommandType
Returns a new instance of CommandType.
5 6 7 8 |
# File 'lib/graphql/api/command_type.rb', line 5 def initialize(inputs, ctx) @inputs = inputs @ctx = ctx end |
Instance Attribute Details
#ctx ⇒ Object
Returns the value of attribute ctx.
3 4 5 |
# File 'lib/graphql/api/command_type.rb', line 3 def ctx @ctx end |
#inputs ⇒ Object
Returns the value of attribute inputs.
3 4 5 |
# File 'lib/graphql/api/command_type.rb', line 3 def inputs @inputs end |
Class Method Details
.actions(*actions) ⇒ Object
20 21 22 23 |
# File 'lib/graphql/api/command_type.rb', line 20 def self.actions(*actions) @actions = actions if actions.any? @actions || [] end |
.inputs(inputs = nil) ⇒ Object
10 11 12 13 |
# File 'lib/graphql/api/command_type.rb', line 10 def self.inputs(inputs=nil) @inputs = inputs if inputs @inputs || {} end |
.returns(fields = nil) ⇒ Object
15 16 17 18 |
# File 'lib/graphql/api/command_type.rb', line 15 def self.returns(fields=nil) @returns = fields if fields @returns || {} end |
Instance Method Details
#perform ⇒ Object
25 26 |
# File 'lib/graphql/api/command_type.rb', line 25 def perform end |