You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
Aggregate queries allow for the return of statistical summaries of records that match certain criteria. For example, one may want to get the count of all transactions in the network. We could support the request with something like the following GraphQL query:
query {
aggregateTransaction {
count
}
}
Additionally, we could allow for advanced aggregate queries by only allowing for certain inputs depending on the entity type and its fields. Here are a few example queries:
Get the average amount per transaction
query {
aggregateTransaction {
amountAvg
}
}
Get the min, max, total, and average of all contract balances
Finally, when you give a field aggregate fooAggregate() { } the fact that it's an aggregation is implied by the field/node name (fooAggregate) thus you only need to name the reducer inside the node (e.g., fooAggregate() { count } )
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Aggregate queries allow for the return of statistical summaries of records that match certain criteria. For example, one may want to get the count of all transactions in the network. We could support the request with something like the following GraphQL query:
Additionally, we could allow for advanced aggregate queries by only allowing for certain inputs depending on the entity type and its fields. Here are a few example queries:
Get the average amount per transaction
Get the min, max, total, and average of all contract balances
Here is some prior work from which we can take inspiration.
The text was updated successfully, but these errors were encountered: