Skip to main content

Truncate Mutation

The Truncate mutation allows you to shorten text fields to a specified length. This is useful for conforming to character limits imposed by different platforms or services.

Options

  • Max Length: The maximum number of characters allowed for the truncated text. Defaults to 50.
  • Ellipsis: The ellipsis string used when truncating. Defaults to '...'.

Example

On Meta (Facebook/Instagram) the production description field has a limit of 9.999 characters. To ensure that the description field is always within the limit, we can use the Truncate mutation to shorten the description to 9.999 characters.

A screenshot showing the Truncate mutation.
Truncate Mutation Example