PaoGon / R.I.M.

0 stars 1 forks source link

Dashboard Current Accident, Current Road Closure and Active City Project #172

Closed jlozion026 closed 1 year ago

jlozion026 commented 1 year ago

image

Current Accident

query {
  aggregateReport(
    where: {
      AND: [
        { report_type: { equals:  RoadAccident} }
        { incident: { is: { date_started: { lte: "get the current date" } } } }
        { incident: { is: { date_ended: { gte: "get the current date" } } } }
      ]
    }
  ) {
    _count {
      report_type
    }
  }
}

Active City Project

query {
  aggregateReport(
    where: {
      AND: [
        { report_type: { equals:  CityProject} }
        { city_project: { is: { date_started: {lte: "get the current date"} } } }
        { city_project: { is: { date_ended: {gte: "get the current date"} } } }
      ]
    }
  ) {
    _count {
      report_type
    }
  }
}

Active Closed Road Today

query {
  aggregateReport(
    where: {
      AND: [
        { report_type: { equals:  RoadClosure} }
        { incident: { is: { date_started: { lte: "get the current date" } } } }
        { incident: { is: { date_ended: { gte: "get the current date" } } } }
      ]
    }
  ) {
    _count {
      report_type
    }
  }
}