> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# getGranularities()

- Package: [@gooddata/sdk-model](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/index.md)
- Kind: function
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-model/src/base/granularityRegistry.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

The single source of truth for "which date granularities apply here".

**Signature:**

```typescript
export declare function getGranularities(query: IGranularitiesQuery): DateAttributeGranularity[];
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| query | [IGranularitiesQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.igranularitiesquery/index.md) |  |

**Returns:**

[DateAttributeGranularity](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.dateattributegranularity/index.md)[]

## Remarks

Returns the calendar-relevant granularities in canonical coarse→fine order. Standard/fiscal chronological granularities come from the registry; a `custom` calendar supplies its own `enabledGranularities` (and their order). The result is calendar-relevant only — callers narrow it to a backend/dataset-supported subset.
