Code Insights: Support filter panel insight creation flow in gql api
Created by: vovakulikov
Closes https://github.com/sourcegraph/sourcegraph/issues/27892
Context
This PR adds support of "save as copy" feature in GQL API. A few notes about implementation. Our backend doesn't support filters in insight creation input mutation. Because of that, we have to create insight first and then call the second network request - updateLineChart mutation (this mutation support filters as an input). After that, we have to update our local cache in apollo to see newly created insight in the dashboard where the user clicked save as new.
Note: this feature doesn't work in virtual dashboards. See https://github.com/sourcegraph/sourcegraph/issues/27906
How to test
- Go to any dashboard except virtual (all insights)
- Try to create insight through the filters panel
- You should see that newly created insight appeared in the dashboard and should have predefined filters that original insight has (an insight that was used to create the current one).
- After refreshing the page everything should stay the same.