debian-mirror-gitlab/app/graphql/mutations/ci/pipeline_schedule/take_ownership.rb
2023-01-13 15:02:22 +05:30

27 lines
708 B
Ruby

# 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