gitlab-org--gitlab-foss/lib/gitlab/graphql/loaders/batch_project_statistics_loader.rb
Alessio Caiazza 83a8b77961 Add Namespace and ProjectStatistics to GraphQL API
We can query namespaces, and nested projects.

Projects now exposes statistics
2019-06-03 12:01:32 +02:00

23 lines
535 B
Ruby

# frozen_string_literal: true
module Gitlab
module Graphql
module Loaders
class BatchProjectStatisticsLoader
attr_reader :project_id
def initialize(project_id)
@project_id = project_id
end
def find
BatchLoader.for(project_id).batch do |project_ids, loader|
ProjectStatistics.for_project_ids(project_ids).each do |statistics|
loader.call(statistics.project_id, statistics)
end
end
end
end
end
end
end