blob: 810f458fd75c72c56ba107a58806d5d456bc3ee5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# frozen_string_literal: true
module Mutations
module Ci
module Pipeline
class Cancel < Base
graphql_name 'PipelineCancel'
authorize :update_pipeline
def resolve(id:)
pipeline = authorized_find!(id: id)
result = ::Ci::CancelPipelineService.new(pipeline: pipeline, current_user: current_user).execute
if result.success?
{ success: true, errors: [] }
else
{ success: false, errors: [result.message] }
end
end
end
end
end
end
|