Skip to content

Insights: Add support filters field for the createLineChartSearchInsight (and possible createPieChartSearchInsight) gql mutations

Created by: vovakulikov

At the moment we can't create insight with filters with just one GQL mutation (createLineChartSearchInsight or createPieChartSearchInsight) But we have this use case in the Code Insights app. With drill-down filter creation flow, we are supposed to create insight with pre-defined filters.

Because we don't have drill-down filters as an input field for insight creation mutations we have to run two queries on the frontend. Creation mutation + updating insight mutation. This brings a lot of complexity on the frontend and since tech debt on the frontend became a very important problem it makes sense to fix this problem on the backend now

Proposal:

Let's have InsightViewFiltersInput as optional field in createLineChartSearchInsight https://sourcegraph.com/github.com/sourcegraph/sourcegraph@ba10961c304e9eda0e34ed6a01025f88fb31c5ca/-/blob/cmd/frontend/graphqlbackend/insights.graphql?L561:7