diff options
Diffstat (limited to 'app/graphql/resolvers/work_items_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/work_items_resolver.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/graphql/resolvers/work_items_resolver.rb b/app/graphql/resolvers/work_items_resolver.rb index d4f73361e05..995f54f35d8 100644 --- a/app/graphql/resolvers/work_items_resolver.rb +++ b/app/graphql/resolvers/work_items_resolver.rb @@ -21,13 +21,18 @@ module Resolvers def resolve_with_lookahead(**args) return WorkItem.none if resource_parent.nil? - finder = ::WorkItems::WorkItemsFinder.new(current_user, prepare_finder_params(args)) - - Gitlab::Graphql::Loaders::IssuableLoader.new(resource_parent, finder).batching_find_all { |q| apply_lookahead(q) } + Gitlab::Graphql::Loaders::IssuableLoader.new( + resource_parent, + finder(prepare_finder_params(args)) + ).batching_find_all { |q| apply_lookahead(q) } end private + def finder(args) + ::WorkItems::WorkItemsFinder.new(current_user, args) + end + def prepare_finder_params(args) params = super(args) params[:iids] ||= [params.delete(:iid)].compact if params[:iid] |