Graphql - how to correctly set inventory location?

Hi All,

Im using graphql activate and then deactivate to set inventory from default location, to a new location.

Activation works as expected:

mutation ActivateInventoryItem($inventoryItemId: ID!, $locationId: ID!, $available: Int) {
inventoryActivate(inventoryItemId: $inventoryItemId, locationId: $locationId, available: $available) {
inventoryLevel {
id
quantities(names: [“available”]) {
name
quantity
}
item {
id
}
location {
id
}
}
}
}

Deactivate the default location works ok too:

mutation inventoryDeactivate($inventoryLevelId: ID!) {
inventoryDeactivate(inventoryLevelId: $inventoryLevelId) {
userErrors {
message
}
}
}

However, when I check in admin console, my product / variant still lists on both Inventories (default & new).

When I check into the product, my Location is correctly set to just 1 location (the new location I activated above).

Any one found this before please? Is there another graphql or additional parameters i need to add to deactivate it from the default Inventory list?

Thanks Len

Thanks for your feedback, I am able to get Location ID, Activate inventory at that Location and adjust quantity if required.

My issue seems to be how to correctly deactivate from the default original Location:

mutation inventoryDeactivate($inventoryLevelId: ID!) {
inventoryDeactivate(inventoryLevelId: $inventoryLevelId) {
userErrors {
message
}
}
}

The above does work, in that I now have the correct Location set for my product / variant.

However, the product / variant still lists against both Inventory dropdowns:

If I click into the product, the Location is correctly set to just 1 (the one I activated above).

Anyone seen this before please?

thanks Len

Solved the issue by using another graphql mutation.

In case anyone else is trying to figure out activating/deactivating products between locations: