I’m using the following GraphQL mutation to create options for a product and include the variant creation strategy:
mutation createOptions($productId: ID!, $options: [OptionCreateInput!]!, $variantStrategy: ProductOptionCreateVariantStrategy) {
productOptionsCreate(productId: $productId, options: $options, variantStrategy: $variantStrategy) {
userErrors {
field
message
code
}
product {
id
variants(first: 10) {
nodes {
id
title
selectedOptions {
name
value
}
}
}
options {
id
name
values
position
optionValues {
id
name
hasVariants
}
}
}
}
}
With the following input:
$variables = [
'productId' => $product_id,
'options' => $options,
'variantStrategy' => "CREATE",
];
However, I’m getting the following error in response:
ProductOptionCreateVariantStrategy isn't a defined input type (on $variantStrategy)
I’m following the documentation precisely, but this error persists. Could someone explain why this error might be occurring or if there’s something wrong with the way I’m passing variantStrategy
?