Skip to main content

removeProductsFromBrand

Requires permission products:brand:update.

Detach products from a brand (clears the product's brand). Only products currently on this brand are affected. Needs the brands update permission.

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:

mutation RemoveProductsFromBrand($brandId: ID!, $productIds: [ID!]!) {
removeProductsFromBrand(brandId: $brandId, productIds: $productIds) {
changedCount
reassignedCount
skippedCount
brand {
id
code
name
createdAt
deletedAt
deletedBy
}
}
}

Variables:

{
"brandId": "id",
"productIds": [
"id"
]
}

Response:

{
"data": {
"removeProductsFromBrand": {
"changedCount": 0,
"reassignedCount": 0,
"skippedCount": 0,
"brand": {
"id": "id",
"code": "string",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"deletedAt": "2025-01-15T00:00:00Z",
"deletedBy": "string"
}
}
}
}
removeProductsFromBrand(
brandId: ID!
productIds: [ID!]!
): BrandProductAssignmentResult!

Arguments​

removeProductsFromBrand.brandId ● ID! non-null scalar​

The ID of the brand.

removeProductsFromBrand.productIds ● [ID!]! non-null scalar​

The IDs of the products.

Type​

BrandProductAssignmentResult object​

The result of assigning existing products to a brand, or removing them.