This is the product
{
“data”: {
“product”: {
“description”: “”,
“descriptionHtml”: “”,
“hasOnlyDefaultVariant”: true,
“id”: “gid://shopify/Product/7991957979306”,
“options”: [
{
“id”: “gid://shopify/ProductOption/10186974494890”,
“name”: “Title”,
“values”: [
“Default Title”
],
“position”: 1
}
],
“productType”: “95”,
“publishedAt”: null,
“status”: “DRAFT”,
“tags”: ,
“title”: “0403M-1605N”,
“variants”: {
“pageInfo”: {
“hasNextPage”: false
},
“edges”: [
{
“cursor”: “eyJsYXN0X2lkIjo0NjExMTIxMjc5ODEyMiwibGFzdF92YWx1ZSI6IjEifQ==”,
“node”: {
“availableForSale”: true,
“barcode”: null,
“compareAtPrice”: null,
“createdAt”: “2024-06-28T18:45:50Z”,
“displayName”: “0403M-1605N - Default Title”,
“id”: “gid://shopify/ProductVariant/46111212798122”,
“inventoryItem”: {
“id”: “gid://shopify/InventoryItem/48141377339562”,
“inventoryLevels”: {
“edges”: [
{
“node”: {
“quantities”: [
{
“quantity”: 0
}
],
“id”: “gid://shopify/InventoryLevel/94498226346?inventory_item_id=48141377339562”
}
}
]
},
“tracked”: false,
“unitCost”: null,
“measurement”: {
“weight”: {
“value”: 0,
“unit”: “KILOGRAMS”
}
}
},
“position”: 1,
“price”: “0.00”,
“selectedOptions”: [
{
“name”: “Title”,
“value”: “Default Title”
}
],
“sku”: “”,
“taxable”: true,
“title”: “Default Title”,
“updatedAt”: “2024-06-28T18:45:50Z”
}
}
]
},
“vendor”: “Harley-Davidson Canada”
}
},
“extensions”: {
“cost”: {
“requestedQueryCost”: 31,
“actualQueryCost”: 13,
“throttleStatus”: {
“maximumAvailable”: 2000,
“currentlyAvailable”: 1987,
“restoreRate”: 100
}
}
}
}
I know it is a single variant product. But before add variant I did add options, as below:
mutation:
mutation createOptions ($productId: ID!, $options: [OptionCreateInput!]!) { productOptionsCreate (productId: $productId, options: $options) { product { id variants (first:10) { nodes { id barcode sku inventoryItem { id } } } options { id name values position optionValues { id name hasVariants } } } userErrors { field message } } }
variable:
{“productId”:“gid://shopify/Product/7991957979306”,“options”:[{“name”:“Taille”,“values”:[{“name”:“S”},{“name”:“XS”},{“name”:“XL”}]}]}