A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Return error: {'errors': [{'message': 'invalid id', 'locations': [{'line': 3, 'column': 7}], 'path': ['inventoryAdjustQuantities']}], 'data': {'inventoryAdjustQuantities': None}, 'extensions': {'cost': {'requestedQueryCost': 11, 'actualQueryCost': 1, 'throttleStatus': {'maximumAvailable': 4000.0, 'currentlyAvailable': 3999, 'restoreRate': 200.0}}}} mutation = ''' mutation inventoryAdjustQuantities($input: InventoryAdjustQuantitiesInput!) { inventoryAdjustQuantities(input: $input) { userErrors { field message } inventoryAdjustmentGroup { reason referenceDocumentUri changes { name delta } } } } ''' input = {'input': {'reason': 'received', 'name': 'available', 'changes': [{'delta': -73, 'inventoryItemId': 'gid://shopify/ProductVariant/40580044554263', 'locationId': 'gid://shopify/Location/{id}'}]}}
I assume someone is going to say that the input field inventoryItemId should have /InventoryItem/ instead of /ProductVariant/. I still get this error from the same mutation:
error = {'data': {'inventoryAdjustQuantities': {'userErrors': [{'field': ['input', 'changes', '0', 'inventoryItemId'], 'message': 'The specified inventory item could not be found.'}], 'inventoryAdjustmentGroup': None}}, 'extensions': {'cost': {'requestedQueryCost': 11, 'actualQueryCost': 10, 'throttleStatus': {'maximumAvailable': 4000.0, 'currentlyAvailable': 3990, 'restoreRate': 200.0}}}}
input = {'input': {'reason': 'received', 'name': 'available', 'changes': [{'delta': -73, 'inventoryItemId': 'gid://shopify/InventoryItem/40580044554263', 'locationId': 'gid://shopify/Location/{id}'}]}}