Skip to content

Insights/api/default applied filters

Warren Gifford requested to merge insights/api/default-applied-filters into main

Created by: coury-clark

Closes https://github.com/sourcegraph/sourcegraph/issues/26388

Implements

  1. default filter logic into the time series resolver
  2. GraphQL argument on insightViews query to override filters
  3. return the AppliedFilters on the InsightViewResolver that are being applied

I made a change to the model of where these filters are applied in the resolver stack. Historically they were applied on the timeseries itself, and in the context of the very old prototype that made sense (it was the only resolver, really). As soon as we have the concept of a view, this model doesn't really work anymore. The premise is that a view is the entity that you can associate filters and aggregates, and they are applied across all of the series within the view.

This PR makes this change in the new API, and moves the filters argument to the insightViews query instead of the sub-resolver for the time series. We will not deprecate the old arguments for the time being to preserve backwards compatibility with the insights query.

This chart uses the old insights query for comparison CleanShot 2021-11-03 at 13 23 45@2x d

This image is resolving the same view through the new API using default filters - the values match. CleanShot 2021-11-03 at 13 24 13@2x

This shows how we can override the filters at query time. CleanShot 2021-11-03 at 13 49 08@2x

Merge request reports

Loading