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/milestone_type.rb')
-rw-r--r--app/graphql/types/milestone_type.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/graphql/types/milestone_type.rb b/app/graphql/types/milestone_type.rb
index 99bd6e819d6..ca606c9da44 100644
--- a/app/graphql/types/milestone_type.rb
+++ b/app/graphql/types/milestone_type.rb
@@ -9,6 +9,8 @@ module Types
authorize :read_milestone
+ alias_method :milestone, :object
+
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the milestone'
@@ -47,5 +49,14 @@ module Types
field :subgroup_milestone, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates if milestone is at subgroup level',
method: :subgroup_milestone?
+
+ field :stats, Types::MilestoneStatsType, null: true,
+ description: 'Milestone statistics'
+
+ def stats
+ return unless Feature.enabled?(:graphql_milestone_stats, milestone.project || milestone.group, default_enabled: true)
+
+ milestone
+ end
end
end