Skip to main content
Version: 3.x

Error Policy

info

This feature was introduced in Saleor 3.11.

caution

This feature is in the Feature Preview stage, which means that it is available for experimentation and feedback. However, it is still undergoing development and is subject to modifications.

Introduction

Error policies were added to Saleor to allow users to choose how bulk mutations should behave if an error occurs. All new bulk mutations support errorPolicy argument.

Options

There are three options, how the mutation can handle errors:

REJECT_EVERYTHING (default)

This is default error policy. If a single error occurs, in at least one of the objects, the whole mutation fails and no data is saved.

REJECT_FAILED_ROWS

The mutation saves only those objects, which do not produce any error.

IGNORE_FAILED

If an error occurs for some object, Saleor will try to save it partially and skip the invalid part, if it is possible.

Policy exceptions

Some mutations can have specific errors, which can change the error policy behavior. For example orderBulkCreate.


Was this page helpful?