Skip to content

feat(graphql): groupBy + aggregate functions on Connection types #1455

@rubenvdlinde

Description

@rubenvdlinde

Context

The @conduction/nextcloud-vue library is adding manifest-driven dashboard widgets that pull aggregated data from OR's GraphQL endpoint (see ConductionNL/nextcloud-vue PR-A — manifest dataSource block on widget definitions). The first cut covers `stats-block` widgets via the existing `Connection.totalCount` field, which works today.

Charts and breakdowns need richer aggregation that OR's GraphQL doesn't expose yet.

Deferred from

Library-side widget dispatcher work (PR-A) intentionally stops at `totalCount`. Chart widgets currently render static `series` / `categories` from the manifest; the lib's new `dataSource.graphql.selectors` form supports any custom query, but there's no server endpoint to query against until this lands.

Ask

Add to OR's generated GraphQL schema:

  1. `groupBy: [String!]` argument on connection list fields. Buckets results by the named property paths (dot-paths into JSON columns). Returns a list of group buckets instead of `edges`.
  2. `aggregate` selection set on each bucket — `{ count, sum(field), avg(field), min(field), max(field) }`.
  3. Optional `having` filter on aggregated values.

Example target query (decidesk meeting status breakdown):
```graphql
{
meetingsList(filter: {}, groupBy: ["lifecycle"]) {
groups {
key { lifecycle }
aggregate { count }
}
}
}
```

Pickup trigger

  • Decidesk / mydash chart widgets need server-driven series.
  • Procest / pipelinq KPI breakdowns (currently client-aggregated) get migrated.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions