Hi everyone,
I am having issues generating variations with images using the productVariantsBulkCreate with graphql.
My mutation:
mutation productVariantsBulkCreate($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
productVariantsBulkCreate(productId: $productId, variants: $variants) {
product {
id title
}
productVariants {
id selectedOptions {
name value
}
price
}
userErrors {
field message
}
}
}
Here is a modified snippet of what i’m sending. The links in my code are valid, but changed here:
{
"productId": "gid://shopify/Product/1000000000001",
"variants":
[
{
"optionValues":
[
{
"optionName": "Color",
"name": "Black"
},
{
"optionName": "Size",
"name": "Small"
}
],
"inventoryItem":
{
"sku": "100001",
"tracked": false
},
"mediaSrc": "https://url.com/image1.jpg",
"price": "19.99"
},
{
"optionValues":
[
{
"optionName": "Color",
"name": "Black"
},
{
"optionName": "Size",
"name": "Medium"
}
],
"inventoryItem":
{
"sku": "100002",
"tracked": false
},
"mediaSrc": "https://url.com/image2.jpg",
"price": "19.99"
},
{
"optionValues":
[
{
"optionName": "Color",
"name": "White"
},
{
"optionName": "Size",
"name": "Large"
}
],
"inventoryItem":
{
"sku": "100003",
"tracked": false
},
"mediaSrc": "https://url.com/image3.jpg",
"price": "19.99"
}
]
}
The listing variations do successfully get created, but the mediasrc doesn’t appear to do anything.
Any help would be appreciated