2020-11-24 15:15:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module Ci
|
|
|
|
class Base < BaseMutation
|
2021-01-03 14:25:43 +05:30
|
|
|
PipelineID = ::Types::GlobalIDType[::Ci::Pipeline]
|
|
|
|
|
|
|
|
argument :id, PipelineID,
|
2020-11-24 15:15:51 +05:30
|
|
|
required: true,
|
2021-02-22 17:27:13 +05:30
|
|
|
description: 'The ID of the pipeline to mutate'
|
2020-11-24 15:15:51 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def find_object(id:)
|
2021-01-03 14:25:43 +05:30
|
|
|
# TODO: remove this line when the compatibility layer is removed
|
|
|
|
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
|
|
|
|
id = PipelineID.coerce_isolated_input(id)
|
2020-11-24 15:15:51 +05:30
|
|
|
GlobalID::Locator.locate(id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|