# Messages

## 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 for retrieving Messages in the platform.**

## Queries

### Query Messages

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

### Get Message

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

## Output types

### Message

> This type is equivalent to [Message](/search.md?urn=ctp:api:type:Message) in REST, with the following differences:
>
> - The fields that are specific to a Message Type, such as `firstName` on a Customer Message, aren't on the Message itself. They are on the [`payload`](/api/graphql/messages.md#messagepayload) field. In REST, they are on the Message.
> - `resourceRef` replaces the REST `resource` field and returns a [Reference](/search.md?urn=ctp:api:type:Reference).
> - `userProvidedIdentifiers` replaces the REST `resourceUserProvidedIdentifiers` field.

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

### MessageQueryResult

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

#### UserProvidedIdentifiers

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

#### MessagePayload

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

## Message payload types

Each Message has a `payload` of a type that implements [MessagePayload](/api/graphql/messages.md#messagepayload). The payload types are grouped by resource on the following pages:

- [Approval Rule and Approval Flow Messages](/api/graphql/messages-approval-rule-approval-flow-messages.md)
- [Business Unit and Associate Role Messages](/api/graphql/messages-business-unit-associate-role-messages.md)
- [Cart and Order Messages](/api/graphql/messages-cart-order-messages.md)
- [Customer Messages](/api/graphql/messages-customer-messages.md)
- [Payment Messages](/api/graphql/messages-payment-messages.md)
- [Pricing and Discount Messages](/api/graphql/messages-pricing-discount-messages.md)
- [Product Catalog Messages](/api/graphql/messages-product-catalog-messages.md)
- [Quote Messages](/api/graphql/messages-quote-messages.md)
- [Shipping Method Messages](/api/graphql/messages-shipping-method-messages.md)
- [Shopping List Messages](/api/graphql/messages-shopping-list-messages.md)
- [Store Messages](/api/graphql/messages-store-messages.md)

## Related pages

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