Skip to content

insights: Extend/change add/remove gql mutation in a way to handle list of insights per one mutation

Created by: vovakulikov

Related GH thread https://github.com/sourcegraph/sourcegraph/issues/23065#issuecomment-1057858501

Background

In the nutshell, at the moment addInsightViewToDashboard and removeInsightViewFromDashboard mutations take only one insight id. But it would be better from the performance point of view for the frontend to have mutations that could take a list of insights for adding or removing them to/from the dashboard.

A good use case for such mutations might be our "Add or remove insights" modal view. At the moment we are sending a package (bulk) GQL mutation request for each added/removed insight there. With a new mutation, we could just run one mutation for adding and one for removing.