Class: Zenaton::Services::GraphQL::CreateTaskScheduleMutation
- Inherits:
-
BaseOperation
- Object
- BaseOperation
- Zenaton::Services::GraphQL::CreateTaskScheduleMutation
- Defined in:
- lib/zenaton/services/graph_ql/create_task_schedule_mutation.rb
Overview
Mutation parameters for scheduling a Task
Instance Method Summary collapse
-
#body ⇒ Object
The body of the GraphQL request.
-
#initialize(task, cron, app_env) ⇒ CreateTaskScheduleMutation
constructor
A new instance of CreateTaskScheduleMutation.
-
#raw_query ⇒ Object
The query to be executed.
-
#variables ⇒ Object
The variables used in the query.
Methods inherited from BaseOperation
Constructor Details
#initialize(task, cron, app_env) ⇒ CreateTaskScheduleMutation
Returns a new instance of CreateTaskScheduleMutation.
10 11 12 13 14 15 |
# File 'lib/zenaton/services/graph_ql/create_task_schedule_mutation.rb', line 10 def initialize(task, cron, app_env) super @task = task @cron = cron @app_env = app_env end |
Instance Method Details
#body ⇒ Object
The body of the GraphQL request
18 19 20 |
# File 'lib/zenaton/services/graph_ql/create_task_schedule_mutation.rb', line 18 def body { 'query' => query, 'variables' => variables } end |
#raw_query ⇒ Object
The query to be executed
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/zenaton/services/graph_ql/create_task_schedule_mutation.rb', line 23 def raw_query <<~GQL mutation ($input: CreateTaskScheduleInput!) { createTaskSchedule(input: $input) { schedule { id } } } GQL end |
#variables ⇒ Object
The variables used in the query
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/zenaton/services/graph_ql/create_task_schedule_mutation.rb', line 36 def variables { 'input' => { 'intentId' => intent_id, 'environmentName' => @app_env, 'cron' => @cron, 'taskName' => @task.class.name, 'programmingLanguage' => 'RUBY', 'properties' => @serializer.encode(@properties.from(@task)) } } end |