Trouble Linking Metafields to Product Options in Shopify API Version 2024-04

Trouble Linking Metafields to Product Options in Shopify API Version 2024-04

Nexzer
Shopify Partner
9 0 3

I'm attempting to use the productOptionUpdate mutation but when I try to set linkedMetafield and linkedMetafieldValue, I am getting the error "option, linkedMetafield: Linked options are not supported for this shop."

I am using the Development store for the extended variants. Is there a way to get permission to use these metafields?

GraphQL Mutation:

Here's the mutation I'm attempting to use:

mutation productOptionUpdate(
  $productId: ID!,
  $option: OptionUpdateInput!,
  $optionValuesToUpdate: [OptionValueUpdateInput!],
  $variantStrategy: ProductOptionUpdateVariantStrategy
) {
  productOptionUpdate(
    productId: $productId,
    option: $option,
    optionValuesToUpdate: $optionValuesToUpdate,
    variantStrategy: $variantStrategy
  ) {
    product {
      id
      options {
        id
        name
        values
        position
        optionValues {
          id
          name
          hasVariants
        }
      }
    }
    userErrors {
      field
      message
    }
  }
}

JavaScript Variables:

And here are the variables I'm passing:

 

const variables = {
  productId: "gid://shopify/Product/9874",
  option: {
    id: "gid://shopify/ProductOption/4321",
    linkedMetafield: {
      namespace: "test1",
      key: "key1",
    },
  },
  optionValuesToUpdate: [
    {
      id: "gid://shopify/ProductOptionValue/1234",
      linkedMetafieldValue: "example",
    }
  ],
};

 

Development Store:

And here is the development store I am using:

Nexzer_0-1712484254894.png

 

Replies 0 (0)