Skip to main content

productBulkDeletePreview

Requires permission products:product:delete.

Read-only blast radius (variant count, open-document/cart references) for a bulk product delete — powers the confirmation dialog.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query ProductBulkDeletePreview($target: ProductBulkTargetInput!) {
productBulkDeletePreview(target: $target) {
buyingListLines
cartLines
defaultVariantCount
missing
openOrderLines
openQuoteLines
lastVariantViolations {
productName
productId
}
}
}

Variables:

{
"target": {}
}

Response:

{
"data": {
"productBulkDeletePreview": {
"buyingListLines": 0,
"cartLines": 0,
"defaultVariantCount": 0,
"missing": 0,
"openOrderLines": 0,
"openQuoteLines": 0,
"lastVariantViolations": [
{
"productName": "string",
"productId": "id"
}
]
}
}
}
productBulkDeletePreview(
target: ProductBulkTargetInput!
): ProductBulkDeletePreview!

Arguments​

productBulkDeletePreview.target ● ProductBulkTargetInput! non-null input​

Which products to delete.

Type​

ProductBulkDeletePreview object​

What a bulk delete would affect, for the confirmation dialog. It writes nothing.