debian-mirror-gitlab/app/graphql/mutations/ci/base.rb

23 lines
575 B
Ruby
Raw Normal View History

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,
description: 'The id of the pipeline to mutate'
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