summaryrefslogtreecommitdiff
path: root/app/graphql/resolvers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 09:09:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 09:09:34 +0000
commit97f0ae7454597105a27df65ffb772949d9d4f3cb (patch)
tree0bf4888e0e9082c8f168a211390a73a6ae810cef /app/graphql/resolvers
parent5ebc4d92cd5fbb46c627eb04d500384893dbe2b4 (diff)
downloadgitlab-ce-97f0ae7454597105a27df65ffb772949d9d4f3cb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql/resolvers')
-rw-r--r--app/graphql/resolvers/merge_requests_resolver.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/app/graphql/resolvers/merge_requests_resolver.rb b/app/graphql/resolvers/merge_requests_resolver.rb
index cda27890d6b..25121dce005 100644
--- a/app/graphql/resolvers/merge_requests_resolver.rb
+++ b/app/graphql/resolvers/merge_requests_resolver.rb
@@ -20,8 +20,17 @@ module Resolvers
args[:iids] ||= [args[:iid]].compact
- args[:iids].map { |iid| batch_load(iid) }
- .select(&:itself) # .compact doesn't work on BatchLoader
+ if args[:iids].any?
+ batch_load_merge_requests(args[:iids])
+ else
+ args[:project_id] = project.id
+
+ MergeRequestsFinder.new(context[:current_user], args).execute
+ end
+ end
+
+ def batch_load_merge_requests(iids)
+ iids.map { |iid| batch_load(iid) }.select(&:itself) # .compact doesn't work on BatchLoader
end
# rubocop: disable CodeReuse/ActiveRecord