---
schema_version: "1"
id: 5b6af004e5bc755cfc7ab8496f684c57b9b2d996e145a98ea18aae321f8013f6
title: Aggregate Queries with GraphQL
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/graphql-api/graphql/guides/aggregate/aggregate.md
canonical_url: https://developer.salesforce.com/docs/platform/graphql/guide/aggregate.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ed9191502c68f8c968f84812f7667a852ed5ccf29c91ee247d5db0f3e5cd565c
products:
  - GraphQL API
---
# Aggregate Queries with GraphQL

| AVAILABLE API VERSION |
| --------------------- |
| API v58.0 and later   |

Aggregating queries enables you to analyze the records in your result. The `uiapi` field includes the [`query`](https://developer.salesforce.com/docs/platform/graphql/schema-conventions.md) and `aggregate` field. The `aggregate` field of `RecordQueryAggregate` type performs queries that group and aggregate over records.

```
{
  uiapi {
    aggregate {
      # fields
    }
  }
}
```

You can roll up and summarize your results with aggregate functions, such as returning your data with these functions:

- Average
- Count
- Distinct count
- Grouping
- Ordering
- Minimum
- Maximum
- Sum

**note:** The aggregate functions don’t apply to all field types. For example, average and sum apply to currency and numeric values but not to string values. See [Aggregate Functions for Field Types](https://developer.salesforce.com/docs/platform/graphql/guide/aggregate-support.md).

## See Also

- [Feature Limitations of Offline GraphQL](https://developer.salesforce.com/docs/atlas.en-us.mobile_offline.meta/mobile_offline/use_graphql_limitations.htm)