App reviews, troubleshooting, and recommendations
I have run into a bit of strange behavior that happens while updating products through Shopify admin Graphql api.
The situation is:
1. A product is created in Shopify with two variants first with color A and second with color B
2. After the product was created, a third variant is added with the same color B that already exists on the second variant
3. When updating that product (with duplicate options), I got a valid response, only 2 variants in the response, not 3, and the SKU on the second variant was updated with the data from the third variant. The third variant wasn't created.
This is the sample request I sent using the bulk API:
{ "input": { "options": [ "Colour" ], "variants": [ { "price": 10.35, "compareAtPrice": 12.95, "sku": "1000023", "id": "48988948955415", "options": [ "A" ] }, { "price": 10.35, "compareAtPrice": 12.95, "sku": "1000024", "id": "48988948988183", "options": [ "B" ] }, { "price": 10.35, "compareAtPrice": 12.95, "sku": "1000025", "inventoryManagement": "SHOPIFY", "inventoryPolicy": "DENY", "options": [ "B" ] } ], "id": "9433084887319" } }
This is the response I got. Note only two variants in the response and no error and the sku changed on the existing variant:
{ "data": { "id": "9433084887319", "variants": [ { "id": "48988948955415", "sku": "1000023", "inventoryItem": { "id": "51034378043671" } }, { "id": "48988948988183", "sku": "1000025", "inventoryItem": { "id": "51034378076439" } } ] }, "__lineNumber": 0, "error": null }
Is this expected behavior? Should we make sure the options are unique before sending them? It is a bit strange to me that sometimes duplicated options are returned as an error but then sometimes variants are just merged.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025