Class: Zenaton::Services::GraphQL::KillWorkflowMutation

Inherits:
BaseOperation
  • Object
show all
Defined in:
lib/zenaton/services/graph_ql/kill_workflow_mutation.rb

Overview

Mutation parameters for stopping a workflow

Instance Method Summary collapse

Methods inherited from BaseOperation

#intent_id, #query, #result

Constructor Details

#initialize(name, custom_id, app_env) ⇒ KillWorkflowMutation

Returns a new instance of KillWorkflowMutation.



10
11
12
13
14
15
# File 'lib/zenaton/services/graph_ql/kill_workflow_mutation.rb', line 10

def initialize(name, custom_id, app_env)
  super
  @name = name
  @custom_id = custom_id
  @app_env = app_env
end

Instance Method Details

#bodyObject

The body of the GraphQL request



18
19
20
# File 'lib/zenaton/services/graph_ql/kill_workflow_mutation.rb', line 18

def body
  { 'query' => query, 'variables' => variables }
end

#raw_queryObject

The query to be executed



23
24
25
26
27
28
29
30
31
# File 'lib/zenaton/services/graph_ql/kill_workflow_mutation.rb', line 23

def raw_query
  <<~GQL
    mutation killWorkflow($input: KillWorkflowInput!) {
      killWorkflow(input: $input) {
        id
      }
    }
  GQL
end

#variablesObject

The variables used in the query



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/zenaton/services/graph_ql/kill_workflow_mutation.rb', line 34

def variables
  {
    'input' => {
      'customId' => @custom_id,
      'environmentName' => @app_env,
      'intentId' => intent_id,
      'programmingLanguage' => 'RUBY',
      'name' => @name
    }
  }
end