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/types/merge_request_type.rb')
-rw-r--r--app/graphql/types/merge_request_type.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/graphql/types/merge_request_type.rb b/app/graphql/types/merge_request_type.rb
index c194b467363..01b02b7976f 100644
--- a/app/graphql/types/merge_request_type.rb
+++ b/app/graphql/types/merge_request_type.rb
@@ -4,6 +4,8 @@ module Types
class MergeRequestType < BaseObject
graphql_name 'MergeRequest'
+ connection_type_class(Types::CountableConnectionType)
+
implements(Types::Notes::NoteableType)
authorize :read_merge_request
@@ -141,6 +143,8 @@ module Types
end
field :task_completion_status, Types::TaskCompletionStatus, null: false,
description: Types::TaskCompletionStatus.description
+ field :commit_count, GraphQL::INT_TYPE, null: true,
+ description: 'Number of commits in the merge request'
def diff_stats(path: nil)
stats = Array.wrap(object.diff_stats&.to_a)
@@ -160,5 +164,14 @@ module Types
hash.merge!(additions: status.additions, deletions: status.deletions, file_count: 1) { |_, x, y| x + y }
end
end
+
+ def commit_count
+ object&.metrics&.commits_count
+ end
+
+ def approvers
+ object.approver_users
+ end
end
end
+Types::MergeRequestType.prepend_if_ee('::EE::Types::MergeRequestType')