#import "ee/security_dashboard/graphql/fragments/vulnerability_severities_count.fragment.graphql"

query vulnerabilitySeveritiesCount(
  $fullPath: ID = ""
  $projectId: [ID!]
  $severity: [VulnerabilitySeverity!]
  $reportType: [VulnerabilityReportType!]
  $scanner: [String!]
  $state: [VulnerabilityState!]
  $scannerId: [VulnerabilitiesScannerID!]
  $hasIssues: Boolean
  $hasResolution: Boolean
  $isGroup: Boolean = false
  $isProject: Boolean = false
  $isInstance: Boolean = false
) {
  instance: instanceSecurityDashboard @include(if: $isInstance) {
    vulnerabilitySeveritiesCount(
      projectId: $projectId
      severity: $severity
      reportType: $reportType
      scanner: $scanner
      state: $state
      scannerId: $scannerId
      hasIssues: $hasIssues
      hasResolution: $hasResolution
    ) {
      ...VulnerabilitySeveritiesCount
    }
  }
  group(fullPath: $fullPath) @include(if: $isGroup) {
    vulnerabilitySeveritiesCount(
      projectId: $projectId
      severity: $severity
      reportType: $reportType
      scanner: $scanner
      state: $state
      scannerId: $scannerId
      hasIssues: $hasIssues
      hasResolution: $hasResolution
    ) {
      ...VulnerabilitySeveritiesCount
    }
  }
  project(fullPath: $fullPath) @include(if: $isProject) {
    vulnerabilitySeveritiesCount(
      severity: $severity
      reportType: $reportType
      scanner: $scanner
      state: $state
      scannerId: $scannerId
      hasIssues: $hasIssues
      hasResolution: $hasResolution
    ) {
      ...VulnerabilitySeveritiesCount
    }
  }
}
