summaryrefslogtreecommitdiff
path: root/app/graphql/resolvers/issues_resolver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/resolvers/issues_resolver.rb')
-rw-r--r--app/graphql/resolvers/issues_resolver.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/app/graphql/resolvers/issues_resolver.rb b/app/graphql/resolvers/issues_resolver.rb
index f103da07666..9d0535a208f 100644
--- a/app/graphql/resolvers/issues_resolver.rb
+++ b/app/graphql/resolvers/issues_resolver.rb
@@ -44,7 +44,7 @@ module Resolvers
description: 'Issues closed after this date'
argument :search, GraphQL::STRING_TYPE,
required: false,
- description: 'Search query for finding issues by title or description'
+ description: 'Search query for issue title or description'
argument :sort, Types::IssueSortEnum,
description: 'Sort issues by this criteria',
required: false,
@@ -63,18 +63,13 @@ module Resolvers
parent = object.respond_to?(:sync) ? object.sync : object
return Issue.none if parent.nil?
- if parent.is_a?(Group)
- args[:group_id] = parent.id
- else
- args[:project_id] = parent.id
- end
-
# Will need to be be made group & namespace aware with
# https://gitlab.com/gitlab-org/gitlab-foss/issues/54520
- args[:iids] ||= [args[:iid]].compact
- args[:attempt_project_search_optimizations] = args[:search].present?
+ args[:iids] ||= [args.delete(:iid)].compact if args[:iid]
+ args[:attempt_project_search_optimizations] = true if args[:search].present?
- issues = IssuesFinder.new(context[:current_user], args).execute
+ finder = IssuesFinder.new(current_user, args)
+ issues = Gitlab::Graphql::Loaders::IssuableLoader.new(parent, finder).batching_find_all
if non_stable_cursor_sort?(args[:sort])
# Certain complex sorts are not supported by the stable cursor pagination yet.
@@ -97,3 +92,5 @@ module Resolvers
end
end
end
+
+Resolvers::IssuesResolver.prepend_if_ee('::EE::Resolvers::IssuesResolver')