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