Skip to content
Snippets Groups Projects

insights: add mutation to update insight views

Created by: CristinaBirkel

Closes #22816

Description

This PR implements the mutation for updates on the LineChartSearchInsight, only to the presentationOptions and the viewControls. So this only updates the properties on the insight_view for now. There will be another PR for modifying the data series.

This deviates slightly from the schema used to create insights so there will be another issue to address that: https://github.com/sourcegraph/sourcegraph/issues/26679

Testing Steps

You can run a query such as this in order to make changes and see the updates:

mutation {
    updateLineChartSearchInsight (
        id: "aW5zaWdodF92aWV3OiJzZWFyY2hJbnNpZ2h0cy5pbnNpZ2h0LnNvTWFueUluc2lnaHRzMiI=",
        input: {
            presentationOptions: {
                title: "Changing the title",
            },
            dataSeries: [],
            viewControls: {
                filters: {
                    includeRepoRegex: "include regex 22",
                    excludeRepoRegex: "exclude regex 22",
                }
            }
        })
    {
        view { id,
                    defaultFilters {
                        excludeRepoRegex,
                        includeRepoRegex
                    }
                    presentation {
                        ... on LineChartInsightViewPresentation {
                          title,
                          seriesPresentation {
                              seriesId,
                              label,
                              color
                          }
                        }
                }
         } 
    }
}

Merge request reports

Approval is optional

Merged by avatar (Nov 7, 2025 1:37am UTC)

Merge details

  • Changes merged into main with 96e70b2e.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading