# Categories

## 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 Categories in the platform.**

## Queries

### Query Categories

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

### Get Category

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

## Mutations

### Create Category

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

### Update Category

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

### Delete Category

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

## Output types

### Category

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

### CategoryQueryResult

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

## Input types

### CategoryDraft

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

### CategoryUpdateAction

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

### Update actions

#### Add Asset

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

#### Add Store

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

#### Change Asset Name

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

#### Change Asset Order

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

#### Change Name

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

#### Change Order Hint

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

#### Change Slug

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

#### Change Parent

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

#### Remove Asset

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

#### Remove Store

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

#### Set Asset Custom Field

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

#### Set Asset Custom Type

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

#### Set Asset Description

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

#### Set Asset Key

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

#### Set Asset Sources

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

#### Set Asset Tags

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

#### Set Custom Field

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

#### Set Custom Type

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

#### Set Description

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

#### Set Key

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

#### Set Meta Description

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

#### Set Meta Keywords

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

#### Set Meta Title

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

#### Set Stores

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

#### Set External ID

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

## Related pages

- [Search documentation and API specs](/search.md)