Hi,
i’ve got un trouble with then productVariantsBulkCreate and the REMOVE_STANDALONE_VARIANT. The options seems not working.
===> https://consciencemp.myshopify.com/admin/api/2025-04/graphql.json
Array
(
[query] => mutation CreateProduct($product: ProductCreateInput!) {
productCreate(product: $product) {
product {
id
title
}
userErrors {
field
message
}
}
}
[variables] => Array
(
[product] => Array
(
[status] => DRAFT
[title] => TEST AJOUT VARIANT
[descriptionHtml] => <p>Manches montées Côtes 1x1 au col, au poignet et à l'ourlet Bande de nuque intérieure en chevrons Demi-lune dans la matière principale à l'arrière du cou Surpiqûre simple au col Surpiqûre à 2 aiguilles centrée sur la couture à l'ourlet, au poignet et à l'emmanchure</p>
[productOptions] => Array
(
[0] => Array
(
[name] => Couleur
[values] => Array
(
[0] => Array
(
[name] => Aqua Blue
)
[1] => Array
(
[name] => Desert Dust
)
)
[position] => 1
)
[1] => Array
(
[name] => Taille
[values] => Array
(
[0] => Array
(
[name] => S
)
[1] => Array
(
[name] => M
)
[2] => Array
(
[name] => L
)
[3] => Array
(
[name] => XL
)
[4] => Array
(
[name] => XXL
)
[5] => Array
(
[name] => 3XL
)
[6] => Array
(
[name] => XXS
)
[7] => Array
(
[name] => XS
)
)
[position] => 2
)
)
)
)
)
== reponse ==
{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/15384061313359","title":"TEST AJOUT VARIANT"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0}}}}
== FIN reponse ==
------------------- callGraph ----------------------------------
===> https://consciencemp.myshopify.com/admin/api/2025-04/graphql.json
Array
(
[query] => mutation ProductVariantsCreate($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
productVariantsBulkCreate(productId: $productId, variants: $variants, strategy: REMOVE_STANDALONE_VARIANT) {
productVariants {
id
title
selectedOptions {
name
value
}
}
userErrors {
field
message
}
}
}
[variables] => Array
(
[productId] => gid://shopify/Product/15384061313359
[variants] => Array
( ... )
)
)
== reponse ==
{"data":{"productVariantsBulkCreate":{"productVariants":[],"userErrors":[{"field":["variants","16"],"message":"The variant 'Aqua Blue / S' already exists. Please change at least one option value."}]}},"extensions":{"cost":{"requestedQueryCost":11,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0}}}}
== FIN reponse ==