VSD - Implement GraphQL query
This issue is about creating a GraphQL node/query for getting the collected counts from the DB.
Similar feature - Usage trends
The usage trends feature provides global counts. There is also an existing GraphQL API:
query usageTrends {
usageTrendsMeasurements(first: 1, identifier: ISSUES) {
nodes {
count
recordedAt
identifier
}
}
}
Result:
{
"data": {
"usageTrendsMeasurements": {
"nodes": [
{
"count": 1134863,
"recordedAt": "2023-02-28T23:54:59Z",
"identifier": "ISSUES"
}
]
}
}
}
Proposed query
It would be great to have similar naming conventions, so we could create a similar developer experience.
Proposed query:
query vsd {
group(fullPath: "") {
valueStreamDashboardUsageOverview(first: 1, identifier: ISSUES) {
nodes {
count // Analytics::ValueStreamDashboard::Count.count
recordedAt // Analytics::ValueStreamDashboard::Count.recorded_at
identifier // Analytics::ValueStreamDashboard::Count.metric
}
}
}
}
The query above returns 1 measurement (the most recent one). This means that the AR scope would be ordered by recorded_at DESC
.
Edited by Adam Hegyi