[VSA] Add GraphQL item pagination
This issue is for implementing the paginated list of related-items for VSA GraphQL API.
Let's add an items
paginated node within the metrics
node since all filters should also apply:
group(fullPath: "gitlab-org") { // or project
valueStreamAnalytics {
valueStreams(id: '') {
// already implemented fields
stages(id: '') {
// already implemented fields
metrics(assignee_username: ...) {
items(pagination arguments:) {
nodes {
duration // provided by the aggregation query
startEventTimestamp // provided by the aggregation query
endEventTimestamp // provided by the aggregation query
title // issues.title or merge_request.title
// see notes below
}
pageInfo {
startCursor
}
}
}
}
}
}
}
Notes
- To provide the list of items we can call the
serialized_records
method on theDataCollector
. We can reuse the invocation logic from #410327 (closed) (requiest params -> data collector) - To decide: use the
serialized_records
method or expose the actual issue or MR types? In this case we probably needs some sort of union type in GraphQL. To be discussed. - At start, we can use offset pagination. Reasoning: the group-level query uses the in-operator optimization which cannot be keyset paginated at the moment (can be done but requires some work).
- Use the default sorting: end event DESC
Edited by Adam Hegyi