# Types

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

## Queries

### Query Types

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

### Get Type

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

## Mutations

### Create Type

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

### Update Type

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

### Delete Type

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

## Output types

### TypeDefinition

> This type is equivalent to [Type](/search.md?urn=ctp:api:type:Type) in REST.
>
> In GraphQL, `resourceTypeIds` is a list of `String` values, not an enum. It accepts the values listed in [ResourceTypeId](/search.md?urn=ctp:api:type:ResourceTypeId).

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

### TypeDefinitionQueryResult

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

#### FieldDefinition

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

#### TextInputHint

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

#### FieldType

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

#### BooleanType

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

#### DateTimeType

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

#### DateType

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

#### EnumType

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

#### EnumValue

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

#### LocalizedEnumType

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

#### LocalizedEnumValue

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

#### LocalizedStringType

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

#### MoneyType

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

#### NumberType

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

#### ReferenceType

> In GraphQL, `referenceTypeId` is a `String`, not an enum. It accepts the values listed in [CustomFieldReferenceValue](/search.md?urn=ctp:api:type:CustomFieldReferenceValue).

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

#### SetType

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

#### StringType

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

#### TimeType

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

## Input types

### TypeDefinitionDraft

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

#### FieldDefinitionInput

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

#### FieldTypeInput

> REST identifies the Field type with a `name` field. In GraphQL, the input has one field per Field type instead: `String`, `LocalizedString`, `Number`, `Money`, `Date`, `Time`, `DateTime`, `Boolean`, `Enum`, `LocalizedEnum`, `Reference`, and `Set`. These names match the `name` values of [FieldType](/search.md?urn=ctp:api:type:FieldType) in REST.

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

#### FieldTypeEnumTypeDraft

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

#### FieldTypeLocalizedEnumTypeDraft

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

#### FieldTypeReferenceTypeDraft

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

#### FieldTypeSetTypeDraft

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

#### FieldTypeSetElementTypeDraft

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

#### SimpleFieldTypeDraft

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

#### EnumValueInput

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

#### LocalizedEnumValueInput

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

### TypeUpdateAction

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

### Update actions

#### Remove Enum Values

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

#### Remove Localized Enum Values

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

#### Add Enum Value

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

#### Add Field Definition

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

#### Add Localized Enum Value

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

#### Change Enum Value Label

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

#### Change Enum Value Order

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

#### Change Label

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

#### Change Field Definition Order

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

#### Change Input Hint

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

#### Change Localized Enum Value Label

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

#### Change Localized Enum Value Order

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

#### Change Key

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

#### Change Name

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

#### Remove Field Definition

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

#### Set Description

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

## Related pages

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