# Attribute Groups

## GraphQL partial SDLs

This is a graphql reference page. In the llms.txt variant, those components link to the shared partial SDL key list instead of trying to resolve inline GraphQL reference content.

Fetch all available partial SDL keys first:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:returnTypesList
```

Then fetch the one or more relevant partial SDL with a key from that list by calling the same endpoint with a schema ID:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:schema:<key>
```

The response body is a JSON object keyed by the requested content ID. For example, the key-list request returns a `ctp:gql-sphere:returnTypesList` field and a schema request returns a `ctp:gql-sphere:schema:<key>` field.

**Queries and mutations for managing Attribute Groups in the platform.**

## Queries

### Query Attribute Groups

[fetch SDL for query attributeGroups](#graphql-partial-sdls).

### Get Attribute Group

[fetch SDL for query attributeGroup](#graphql-partial-sdls).

## Mutations

### Create Attribute Group

[fetch SDL for mutation createAttributeGroup](#graphql-partial-sdls).

### Update Attribute Group

[fetch SDL for mutation updateAttributeGroup](#graphql-partial-sdls).

### Delete Attribute Group

[fetch SDL for mutation deleteAttributeGroup](#graphql-partial-sdls).

## Output types

### AttributeGroup

[fetch SDL for type AttributeGroup](#graphql-partial-sdls).

### AttributeGroupQueryResult

[fetch SDL for type AttributeGroupQueryResult](#graphql-partial-sdls).

## Input types

### AttributeGroupDraft

[fetch SDL for type AttributeGroupDraft](#graphql-partial-sdls).

### AttributeReferenceInput

[fetch SDL for type AttributeReferenceInput](#graphql-partial-sdls).

### AttributeGroupUpdateAction

[fetch SDL for type AttributeGroupUpdateAction](#graphql-partial-sdls).

### Update actions

#### Add Attribute

[fetch SDL for type AddAttributeGroupAttribute](#graphql-partial-sdls).

#### Change Name

[fetch SDL for type ChangeAttributeGroupName](#graphql-partial-sdls).

#### Remove Attribute

[fetch SDL for type RemoveAttributeGroupAttribute](#graphql-partial-sdls).

#### Set Description

[fetch SDL for type SetAttributeGroupDescription](#graphql-partial-sdls).

#### Set Key

[fetch SDL for type SetAttributeGroupKey](#graphql-partial-sdls).

#### Set Attributes

[fetch SDL for type SetAttributeGroupAttributes](#graphql-partial-sdls).

## Related pages

- [Area overview page with navigation](/api.md)
- [Previous page: REST](/api/projects/attribute-groups.md)
- [Search documentation and API specs](/search.md)