Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/ci/job/base.rb')
-rw-r--r--app/graphql/mutations/ci/job/base.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/graphql/mutations/ci/job/base.rb b/app/graphql/mutations/ci/job/base.rb
new file mode 100644
index 00000000000..3359def159a
--- /dev/null
+++ b/app/graphql/mutations/ci/job/base.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module Mutations
+ module Ci
+ module Job
+ class Base < BaseMutation
+ JobID = ::Types::GlobalIDType[::Ci::Build]
+
+ argument :id, JobID,
+ required: true,
+ description: 'The ID of the job to mutate.'
+
+ def find_object(id: )
+ # TODO: remove this line when the compatibility layer is removed
+ # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
+ id = JobID.coerce_isolated_input(id)
+ GlobalID::Locator.locate(id)
+ end
+ end
+ end
+ end
+end