diff options
Diffstat (limited to 'app/graphql/mutations/ci/job/retry.rb')
-rw-r--r-- | app/graphql/mutations/ci/job/retry.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/graphql/mutations/ci/job/retry.rb b/app/graphql/mutations/ci/job/retry.rb new file mode 100644 index 00000000000..a61d5dddb40 --- /dev/null +++ b/app/graphql/mutations/ci/job/retry.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Mutations + module Ci + module Job + class Retry < Base + graphql_name 'JobRetry' + + field :job, + Types::Ci::JobType, + null: true, + description: 'The job after the mutation.' + + authorize :update_build + + def resolve(id:) + job = authorized_find!(id: id) + project = job.project + + ::Ci::RetryBuildService.new(project, current_user).execute(job) + { + job: job, + errors: errors_on_object(job) + } + end + end + end + end +end |