Commit 83681a9e authored by Sean McGivern's avatar Sean McGivern

Merge branch 'issue_34226' into 'master'

Improve issues search perfomance on GraphQL

See merge request gitlab-org/gitlab!20784
parents f325035b 44fd05ec
......@@ -53,6 +53,7 @@ module Resolvers
# https://gitlab.com/gitlab-org/gitlab-foss/issues/54520
args[:project_id] = project.id
args[:iids] ||= [args[:iid]].compact
args[:attempt_project_search_optimizations] = args[:search].present?
IssuesFinder.new(context[:current_user], args).execute
end
......
---
title: Improve issues search performance on GraphQL
merge_request: 20784
author:
type: performance
......@@ -68,8 +68,22 @@ describe Resolvers::IssuesResolver do
end
end
it 'searches issues' do
expect(resolve_issues(search: 'foo')).to contain_exactly(issue2)
context 'when searching issues' do
it 'returns correct issues' do
expect(resolve_issues(search: 'foo')).to contain_exactly(issue2)
end
it 'uses project search optimization' do
expected_arguments = {
search: 'foo',
attempt_project_search_optimizations: true,
iids: [],
project_id: project.id
}
expect(IssuesFinder).to receive(:new).with(anything, expected_arguments).and_call_original
resolve_issues(search: 'foo')
end
end
describe 'sorting' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment