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

# IAttributesQuery

- Package: [@gooddata/sdk-backend-spi](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/index.md)
- Kind: interface
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-backend-spi/src/workspace/attributes/index.ts

Service to query attributes.

**Signature:**

```typescript
export interface IAttributesQuery 
```

## Methods

| Method | Description |
| --- | --- |
| [query()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md#iattributesqueryquery) | Starts the query. |
| [withFilter(filter)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md#iattributesquerywithfilter) | Sets filter for the query. |
| [withInclude(include)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md#iattributesquerywithinclude) | Sets include for the query. |
| [withMethod(method)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md#iattributesquerywithmethod) | **_(BETA)_** Selects which backend endpoint flavor to use when listing attributes. Default method: "GET" |
| [withOrigin(origin)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md#iattributesquerywithorigin) | Sets origin for the query. |
| [withPage(page)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md#iattributesquerywithpage) | Sets starting page for the query. Backend WILL return no data if the page is greater than total number of pages. Default page: 0 |
| [withSize(size)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md#iattributesquerywithsize) | Sets number of attributes to return per page. Default size: 50 |
| [withSorting(sort)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md#iattributesquerywithsorting) | Sets sorting for the query. |

## Method details

### IAttributesQuery.query()

Starts the query.

**Signature:**

```typescript
query(): Promise<IAttributesQueryResult>;
```
**Returns:**

Promise&lt;[IAttributesQueryResult](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesqueryresult/index.md)&gt;

promise of first page of the results

### IAttributesQuery.withFilter()

Sets filter for the query.

**Signature:**

```typescript
withFilter(filter: IAttributesQueryFilterOptions): IAttributesQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| filter | [IAttributesQueryFilterOptions](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesqueryfilteroptions/index.md) | filter to apply |

**Returns:**

[IAttributesQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md)

attributes query

### IAttributesQuery.withInclude()

Sets include for the query.

**Signature:**

```typescript
withInclude(include: string[]): IAttributesQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| include | string[] | include to apply |

**Returns:**

[IAttributesQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md)

attributes query

### IAttributesQuery.withMethod()

> **Beta API.** Mostly stable, but details may change in a minor release, outside SemVer. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Selects which backend endpoint flavor to use when listing attributes. Default method: "GET"

**Signature:**

```typescript
withMethod(method: QueryMethod): IAttributesQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| method | [QueryMethod](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.querymethod/index.md) | endpoint flavor to use ("GET" or "POST") |

**Returns:**

[IAttributesQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md)

attributes query

### IAttributesQuery.withOrigin()

Sets origin for the query.

**Signature:**

```typescript
withOrigin(origin: ObjectOrigin | (string & {})): IAttributesQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| origin | ObjectOrigin \| (string &amp; {}) | origin to apply. This is an open string union to allow platform-specific origin values in addition to the built-in literals. |

**Returns:**

[IAttributesQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md)

attributes query

### IAttributesQuery.withPage()

Sets starting page for the query. Backend WILL return no data if the page is greater than total number of pages. Default page: 0

**Signature:**

```typescript
withPage(page: number): IAttributesQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| page | number | zero indexed, must be non-negative |

**Returns:**

[IAttributesQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md)

attributes query

### IAttributesQuery.withSize()

Sets number of attributes to return per page. Default size: 50

**Signature:**

```typescript
withSize(size: number): IAttributesQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| size | number | desired max number of attributes per page must be a positive number |

**Returns:**

[IAttributesQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md)

attributes query

### IAttributesQuery.withSorting()

Sets sorting for the query.

**Signature:**

```typescript
withSorting(sort: string[]): IAttributesQuery;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| sort | string[] | Sorting criteria in the format: property,(asc\|desc). Default sort order is ascending. Multiple sort criteria are supported. |

**Returns:**

[IAttributesQuery](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributesquery/index.md)

attributes query
