summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/ci/pipeline/retry.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/ci/pipeline/retry.rb')
-rw-r--r--app/graphql/mutations/ci/pipeline/retry.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/graphql/mutations/ci/pipeline/retry.rb b/app/graphql/mutations/ci/pipeline/retry.rb
new file mode 100644
index 00000000000..a12330470f0
--- /dev/null
+++ b/app/graphql/mutations/ci/pipeline/retry.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module Mutations
+ module Ci
+ module Pipeline
+ class Retry < Base
+ graphql_name 'PipelineRetry'
+
+ field :pipeline,
+ Types::Ci::PipelineType,
+ null: true,
+ description: 'The pipeline after mutation.'
+
+ authorize :update_pipeline
+
+ def resolve(id:)
+ pipeline = authorized_find!(id: id)
+ project = pipeline.project
+
+ ::Ci::RetryPipelineService.new(project, current_user).execute(pipeline)
+ {
+ pipeline: pipeline,
+ errors: errors_on_object(pipeline)
+ }
+ end
+ end
+ end
+ end
+end