Welcome to mirror list, hosted at ThFree Co, Russian Federation.

play.rb « job « ci « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 99f62ea3e706c2a4f93868292b44514a8782aa0d (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
26
27
28
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: '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