PostGraphile has support in its plugin system for powerful aggregates. This system was only introduced in 4.4 and is not well documented yet; should you need aggregates good starting points are:
PgConnectionTotalCountPluginwhich adds a
totalCountaggregate to connections, counting all rows that match the criteria (ignoring pagination info)
- The @graphile/pg-aggreates module
sumaggregates to the schema (more to come)
The Discord chat (feel free to @benjie in
Aggregates are performed over the entire collection - not just the data that
would be returned if you were to query the nodes. This means they ignore the
offset arguments. This is deliberate
(if you only need aggregates over the data that matches your pagination
information then you could calculate these on the client).
If you're using
simpleCollections: "only" you can override it on a
per-collection basis with the
@simpleCollections smart comment.