GraphQL endpoint for CI usage historical data by month/project

Problem to solve

We need to add a way to provide data to frontend, via a GraphQL endpoint to display on the CI/CD Analytics page CI minutes usage data by month and by the project in a given month.

Proposal

The GraphQL response for CI minutes usage:

// ciMinutesUsage.nodes

[
  {
    "month": "January",
    "minutes": 310,
    "projects": [
      { "name": "Project-1", "minutes": 100 },
      { "name": "Project-2", "minutes": 120 },
      { "name": "Project-3", "minutes": 90 },
    ],
  },
  {
    "month": "February",
    "minutes": 310,
    "projects": [
      { "name": "Project-1", "minutes": 100 },
      { "name": "Project-2", "minutes": 120 },
      { "name": "Project-3", "minutes": 90 },
    ],
  },
];

The example GraphQL query

query {
  ciMinutesUsage {
    nodes {
      month
      minutes
      projects {
        nodes {
          name
          minutes
        }
      }
    }
  }
}
Edited by Avielle Wolfe