diff options
Diffstat (limited to 'app/graphql/mutations/ci/job/play.rb')
-rw-r--r-- | app/graphql/mutations/ci/job/play.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/graphql/mutations/ci/job/play.rb b/app/graphql/mutations/ci/job/play.rb new file mode 100644 index 00000000000..f87904f8b25 --- /dev/null +++ b/app/graphql/mutations/ci/job/play.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Mutations + module Ci + module Job + class Play < Base + graphql_name 'JobPlay' + + 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::PlayBuildService.new(project, current_user).execute(job) + { + job: job, + errors: errors_on_object(job) + } + end + end + end + end +end |