summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/commits/create.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/commits/create.rb')
-rw-r--r--app/graphql/mutations/commits/create.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/graphql/mutations/commits/create.rb b/app/graphql/mutations/commits/create.rb
index 84933fee5d2..2e06e1ea0c4 100644
--- a/app/graphql/mutations/commits/create.rb
+++ b/app/graphql/mutations/commits/create.rb
@@ -5,6 +5,11 @@ module Mutations
class Create < BaseMutation
include FindsProject
+ class UrlHelpers
+ include GitlabRoutingHelper
+ include Gitlab::Routing
+ end
+
graphql_name 'CommitCreate'
argument :project_path, GraphQL::ID_TYPE,
@@ -29,6 +34,11 @@ module Mutations
required: true,
description: 'Array of action hashes to commit as a batch.'
+ field :commit_pipeline_path,
+ GraphQL::STRING_TYPE,
+ null: true,
+ description: "ETag path for the commit's pipeline."
+
field :commit,
Types::CommitType,
null: true,
@@ -50,6 +60,7 @@ module Mutations
{
commit: (project.repository.commit(result[:result]) if result[:status] == :success),
+ commit_pipeline_path: UrlHelpers.new.graphql_etag_pipeline_sha_path(result[:result]),
errors: Array.wrap(result[:message])
}
end