graphqlbackend: add searchFilterSuggestions and update search APIs
Created by: unknwon
This PR includes changes of backend (i.e. GraphQL APIs) as part of RFC 14: Improve autocomplete suggestions.
- Web team please review changes related to GraphQL API.
- Core services team please review all changes.
Two major changes:
- Added
searchFilterSuggestions
API for preloading available search filters and their default suggestions when backfill. - Updated
search
API, in particular, thesuggestions
node to add language suggestions for the search filterlang:
whenrepo:
filter is explicitly specified (as a performant way to only process one repository for quicker suggestion).
Other:
- Please ignore changes in the file web/src/search/input/Suggestion.tsx, as these changes are for the very purpose of compromising CI tests since we don't have corresponding frontend code in place, and are meant reverted before merging.
Test plan:
- Unit tests are added for
search
andsearchFilterSuggestions
APIs. I will add unit tests forsearchFilterSuggestions
API once got approval of this API design and implementation from the team.