# Product Selections

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

## Queries

### Query Product Selections

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

### Get Product Selection

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

### Query Product Selection Assignments

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

## Mutations

### Create Product Selection

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

### Update Product Selection

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

### Delete Product Selection

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

## Output types

### ProductSelection

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

### ProductSelectionQueryResult

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

### ProductAssignmentQueryResult

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

## Input types

### CreateProductSelectionDraft

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

### ProductSelectionUpdateAction

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

### Update actions

#### Add Product

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

#### Change Name

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

#### Exclude Product

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

#### Remove Product

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

#### Set Custom Field

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

#### Set Custom Type

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

#### Set Key

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

#### Set Variant Exclusion

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

#### Set Variant Selection

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

## Related pages

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