Log in
Helper

GraphQlExceptionMessageFormatter

Magento\GraphQl\Helper\Error\MessageFormatters\GraphQlExceptionMessageFormatter

What it does

This helper class checks if an exception thrown during GraphQL query resolution is already properly formatted for GraphQL responses.

If the exception is one of Magento's GraphQL-specific exceptions (like GraphQlInputException or GraphQlAuthorizationException), it returns it unchanged; otherwise, it returns null to allow other formatters to process it.

Developers use this as part of the exception handling chain to preserve pre-formatted GraphQL errors.

Public Methods

  • getFormatted()