Hello,
I am having an issue, where I have a created a new location, and when I go to update the inventory levels for all the locations, the newly created location is not getting an inventory level created for it.
I am using this GraphQL query:
mutation productUpdate($input: ProductInput!) {
productUpdate(input: $input) {
product {
id
variants (first: 10) {
edges {
node {
inventoryItem {
inventoryLevels (first: 10){
edges{
node{
location{
name
}
}
}
}
}
}
}
}
}
userErrors {
field
message
}
}
}
With the following input:
{
"input": {
"id": "gid://shopify/Product/123",
"variants": [
{
"inventoryQuantities": [
{
"locationId": "gid://shopify/Location/1",
"availableQuantity": 0
},
{
"locationId": "gid://shopify/Location/2",
"availableQuantity": 0
},
{
"locationId": "gid://shopify/Location/3",
"availableQuantity": 0
},
{
"locationId": "gid://shopify/Location/4",
"availableQuantity": 0
}
],
"options": [
"WHITE",
"6",
"M"
]
}
]
}
}
The response I receive just has 1 inventory level location in it. I am expecting the item to update and place all 4 locations’ inventory into it. Is this the expected result? I am wondering if there is some way to insert/create the inventory level/locations for all the locations while doing an update.
Thank you,
Travis