Skip to main content

productVariantBulkDeletePreview

Requires permission products:product:delete.

Read-only blast radius (default-variant/last-variant checks, open-document/cart references) for a bulk variant delete.

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 ProductVariantBulkDeletePreview($input: ProductVariantBulkDeleteInput!) {
productVariantBulkDeletePreview(input: $input) {
buyingListLines
cartLines
defaultVariantCount
missing
openOrderLines
openQuoteLines
lastVariantViolations {
productName
productId
}
}
}

Variables:

{
"input": {
"variantIds": [
"id"
]
}
}

Response:

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

Arguments​

productVariantBulkDeletePreview.input ● ProductVariantBulkDeleteInput! non-null input​

The details of the product variant bulk delete request.

Type​

ProductBulkDeletePreview object​

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