diff options
Diffstat (limited to 'app/graphql/mutations/ci/pipeline_schedule/take_ownership.rb')
-rw-r--r-- | app/graphql/mutations/ci/pipeline_schedule/take_ownership.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/graphql/mutations/ci/pipeline_schedule/take_ownership.rb b/app/graphql/mutations/ci/pipeline_schedule/take_ownership.rb new file mode 100644 index 00000000000..2e4312f0045 --- /dev/null +++ b/app/graphql/mutations/ci/pipeline_schedule/take_ownership.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Mutations + module Ci + module PipelineSchedule + class TakeOwnership < Base + graphql_name 'PipelineScheduleTakeOwnership' + + authorize :take_ownership_pipeline_schedule + + field :pipeline_schedule, + Types::Ci::PipelineScheduleType, + description: 'Updated pipeline schedule ownership.' + + def resolve(id:) + schedule = authorized_find!(id: id) + + service_response = ::Ci::PipelineSchedules::TakeOwnershipService.new(schedule, current_user).execute + { + pipeline_schedule: schedule, + errors: service_response.errors + } + end + end + end + end +end |