Latest Admin GraphQl API not working properly

Topic summary

Users are experiencing issues with Shopify’s productCreate GraphQL Admin API when creating products with multiple option values.

Core Problem:

  • When creating a product with options (e.g., size: large, small, medium), only one option value (large) is being created successfully, despite receiving a 200 response code.
  • The same issue occurs with alternative APIs like productOptionsCreate and productVariantsCreate/productVariantsBulkCreate.

Current Status:

  • The issue persists as of September 2024 across multiple API endpoints.
  • One user identified the root cause: product options do not automatically generate variants.

Workaround:

  • After creating product options using the API, developers must manually create all product variants separately.
  • Once variants are created, the previously saved options will appear correctly.
  • Note: Shopify has a limit of 100 variants per product.

Resolution: The discussion appears resolved with the workaround, though users find the behavior counterintuitive compared to expected automatic variant generation.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

Im trying to create new product with options using the productCreate Graphql Admin API . But unfortunatly it is not working properly.

Below is my mutation request:

mutation {
  productCreate(input: {
        title: "demo product 4",
        productType: "Snowboard",
        productOptions: [
            {
                name: "size",
                values: [{
                    name: "large"
                },
                {
                    name: "small"
                },
                { 
                  name: "medium"
                }
              ]
            }
        ]
    }) {
    product {
      id
      hasOnlyDefaultVariant
    }
     userErrors {
      message
      field
    }
  }
}

the response is 200. but when i see the created product in admin only the size-large option is created, other values like small and medium are not created.

i also tried product options create API also, but unfortunatly im facing same issue there also. Please help..

2 Likes

I am also banging my head over this issue and whats more concerning is the fact this authors post is from May :confused:

1 Like

it still doesn’t work in 24 september 2024, i tried with productVariantsBulkCreate / productOptionsCreate / productCreate and ofc none works

The correct method is as above but the options will not automatically generate variations on the product. Its down to you to then create all the product variations at which point the previously saved options will magically appear.

Then you need to hope your variations count does not exceed 100.

1 Like

seems weird for me but it works thanks

1 Like