How do you create a product with the default variant with productSet?

Topic summary

Creating a product with a hidden default variant via productSet resulted in a visible option instead. Supplying optionName “Title” with value “Default title” made Shopify treat it as an explicit product option, not the hidden default.

Details: The mutation included productOptions [{ name: “Title”, values: [“Default title”] }] and a variant with optionValues matching that pair, which produced one variant with a visible “Title” option. A screenshot showed the variant and option present rather than the hidden default.

Resolution: Capitalization is critical. Using “Default Title” (capital T) instead of “Default title” triggers creation of the default hidden variant. No other structural changes to the mutation were required.

Outcome: Issue resolved; the key fix is exact casing of “Default Title”. Discussion closed without further open questions.

Summarized with AI on December 16. AI used: gpt-5.

I’m trying to create a product with a default variant using productSet, but the below results in an option being defined, rather than the ‘hidden’ default option for a product with no variants/options.

It appears if you pass in ‘Title’ and ‘Default title’ it interprets these as actual options, not as a default option

mutation createProductAsynchronous($productSet: ProductSetInput!, $synchronous: Boolean!) {
  productSet(synchronous: $synchronous, input: $productSet) {
    product {
      id
    }
    productSetOperation {
      id
      status
      userErrors {
        code
        field
        message
      }
    }
    userErrors {
      code
      field
      message
    }
  }
}
{
  "synchronous": false,
  "productSet": {
    "title": "GraphiQL Product 3",
    "status": "ACTIVE",
    "variants": [
      {
        "optionValues": [
          {
            "optionName": "Title",
            "name": "Default title"
          }
        ],
        "price": "9.99",
        "compareAtPrice": "10.99"
      }
    ],
    "productOptions": [
      {
        "name": "Title",
        "values": [
          {
            "name": "Default title"
          }
        ]
      }
    ]
  }
}

1 Like

PEBCAK solution on this one :sweat_smile:

The correct value is related to capitalisation - it needs to be “Default Title” not “Default title” - to generate a default variant

1 Like