Skip to content
Snippets Groups Projects

insights: Add dashboardReferenceCount to InsightViews returned via the API

Created by: CristinaBirkel

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

Description

We want to be able to display the total number of dashboards an insight is on, (regardless of permissions.) This PR adds a dashboardReferenceCount to the InsightView object in GraphQL.

Testing Steps

Query for insight views and check that the dashboardReferenceCount value is what you expect. You can add/remove insights from dashboards to test that it goes up and down as well!

query { insightViews {
  nodes {
	id,
        dashboardReferenceCount,
        presentation {
        ... on LineChartInsightViewPresentation {
            title,
        },
        ... on PieChartInsightViewPresentation {
            title,
        }
     }
  }
}
}

Merge request reports

Approval is optional

Merged by avatar (Nov 11, 2025 6:12am UTC)

Merge details

  • Changes merged into main with 93dfd273.
  • 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