Hi there,
I’m following the new mutation rules to apply stock update
I tested successfully inventoryAdjustQuantities & inventorySetOnHandQuantities mutation.
query
query_template = '''
mutation inventorySetQuantities($input: InventorySetQuantitiesInput!) {
inventorySetQuantities(input: $input) {
inventoryAdjustmentGroup {
reason
referenceDocumentUri
changes {
name
delta
quantityAfterChange
}
}
userErrors {
code
field
message
}
}
}
'''
# Variables for the mutation
variables = {
"input": {
"name": "available",
"reason": "correction",
"referenceDocumentUri": "logistics://some.warehouse/take/2023-01-23T13:14:15Z",
"quantities": [
{
"inventoryItemId": "gid://shopify/InventoryItem/49021181952338",
"locationId": "gid://shopify/Location/63449858218",
"quantity": 11,
"compareQuantity": 1
}
]
}
}
But with the InventorySetQuantitiesInput I have this error
{‘errors’: [{‘message’: “InventorySetQuantitiesInput isn’t a defined input type (on $input)”, ‘locations’: [{‘line’: 2, ‘column’: 33}], ‘path’: [‘mutation inventorySetQuantities’], ‘extensions’: {‘code’: ‘variableRequiresValidType’, ‘typeName’: ‘InventorySetQuantitiesInput’, ‘variableName’: ‘input’}}, {‘message’: “Field ‘inventorySetQuantities’ doesn’t exist on type ‘Mutation’”, ‘locations’: [{‘line’: 3, ‘column’: 3}], ‘path’: [‘mutation inventorySetQuantities’, ‘inventorySetQuantities’], ‘extensions’: {‘code’: ‘undefinedField’, ‘typeName’: ‘Mutation’, ‘fieldName’: ‘inventorySetQuantities’}}, {‘message’: ‘Variable $input is declared by inventorySetQuantities but not used’, ‘locations’: [{‘line’: 2, ‘column’: 1}], ‘path’: [‘mutation inventorySetQuantities’], ‘extensions’: {‘code’: ‘variableNotUsed’, ‘variableName’: ‘input’}}]}
I search as well in the PostMan definition, I can Find inventoryAdjustQuantities & inventorySetOnHandQuantities method but not InventorySetQuantitiesInput
so this mutation is it available ?
thanks in advance
