summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/ci/base.rb
blob: aaece2a302123d1f57fd26e484cccef5f7a82107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Mutations
  module Ci
    class Base < BaseMutation
      PipelineID = ::Types::GlobalIDType[::Ci::Pipeline]

      argument :id, PipelineID,
                required: true,
                description: 'The id of the pipeline to mutate'

      private

      def find_object(id:)
        # 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)
        GlobalID::Locator.locate(id)
      end
    end
  end
end