summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/ci/pipeline/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/ci/pipeline/base.rb')
-rw-r--r--app/graphql/mutations/ci/pipeline/base.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/graphql/mutations/ci/pipeline/base.rb b/app/graphql/mutations/ci/pipeline/base.rb
new file mode 100644
index 00000000000..ebfab56e743
--- /dev/null
+++ b/app/graphql/mutations/ci/pipeline/base.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+module Mutations
+ module Ci
+ module Pipeline
+ 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
+end