Variant Strategy is Undefined While Creating Product Options

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?

Hey there,

To me it looks fine as you do it. I’m also having an issue with productOptions. Could you try doing the mutation through the webinterface and see if it works there?

This is my post on the forum and I am wondering if the issues are related