insights: graphql query schema to support insights based on a search query#39518
Conversation
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 2531c58...3c24e0a.
|
| """ | ||
| 30 day percentage change in result count rounded to nearest whole number | ||
| """ | ||
| thirtyDayPercentChange: Int! |
There was a problem hiding this comment.
If we calculate the percentage in the insights backend we will be unable to use the result count number that comes from the initial search. I think that for the purposes of a prototype this is fine, but I think long term we need to be thinking about minimizing the impact of this on search performance.
There was a problem hiding this comment.
I was assuming I was going to need to modify the query to include a count:99999 so that we get a full count but if it was less than 500 it could certainly be reused. In that case I could instead provide a 30 day old count or a resultCount(daysAgo int).
| """ | ||
| QueryInsights are Insights that are available based on a search query. This type is experimental and should be considered unstable in the API. | ||
| """ | ||
| type QueryInsights { |
There was a problem hiding this comment.
This might make more sense named SearchQueryInsights, but it's not a huge deal.
vovakulikov
left a comment
There was a problem hiding this comment.
GQL schema seems legit from the frontend perspective
Adds a new query that will eventually support some just in time insights that are based off a search query. This PR adds only the graphql schema and hard codes the result to the
QueryInsightsNotAvailabletype.related to https://github.com/sourcegraph/sourcegraph/issues/39222
Test plan
query
result:
{ "data": { "queryInsights": { "__typename": "QueryInsightsNotAvailable" } } }