# Approval Rules

## 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.

**Mutations and types for managing Approval Rules in the platform.**

## Mutations

### Create Approval Rule

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

### Update Approval Rule

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

## Output types

### ApprovalRule

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

### ApprovalRuleQueryResult

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

## Input types

### ApprovalRuleDraft

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

### ApprovalRuleUpdateAction

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

### Update actions

#### Definition

##### Set Key

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

##### Set Name

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

##### Set Description

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

##### Set Status

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

#### Conditions

##### Set Predicate

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

##### Set Requesters

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

##### Set Approvers

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

#### Custom Fields

##### Set Custom Type

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

##### Set Custom Field

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

## Related pages

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