Re: Can mutations with multiple line input be partially processed? (Using inventorySetOnHandQuantiti

Solved

Can mutations with multiple line input be partially processed? (Using inventorySetOnHandQuantities)

Loxena
Visitor
2 0 0

Hi - I'm using the inventorySetOnHandQuantities mutation and want to check a couple of things:

- If some of the InventorySetQuantityInput lines are valid and some aren't, will those which are valid still be processed?

- Any tips in handling the userErrors for those which aren't?  
e.g. for the following return, does the number 1 under field refer to the 2nd item being invalid?
Many thanks for your help 👍

{
    "data": {
        "inventorySetOnHandQuantities": {
            "userErrors": [
                {
                    "code": "INVALID_INVENTORY_ITEM",
                    "field": [
                        "input",
                        "setQuantities",
                        "1",
                        "inventoryItemId"
                    ],
                    "message": "The specified inventory item could not be found."
                }
            ],
            "inventoryAdjustmentGroup": null
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 11,
            "actualQueryCost": 10,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 990,
                "restoreRate": 50.0
            }
        }
    }
}

 

 

Accepted Solution (1)

garyrgilbert
Shopify Partner
431 41 181

This is an accepted solution.

I'd have to see the data you submitted to be sure, but I think it means the position of the element in the json array, so yeah, in this case it is probably the second inventoryitemid that doesnt exist. But I guess you would be in the best position to test that out.

 

Cheers,

Gary

 

 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

View solution in original post

Replies 3 (3)

garyrgilbert
Shopify Partner
431 41 181

This is an accepted solution.

I'd have to see the data you submitted to be sure, but I think it means the position of the element in the json array, so yeah, in this case it is probably the second inventoryitemid that doesnt exist. But I guess you would be in the best position to test that out.

 

Cheers,

Gary

 

 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

Loxena
Visitor
2 0 0

Cheers @garyrgilbert for your reply - appreciated 👍

I agree that is seem to be the case, and would like technical confirmation for this and whether the batch processing is partially processed or completely thrown out as the processing needed is quite different!

garyrgilbert
Shopify Partner
431 41 181

Hi Loxena,

 

That should be easy to verify, just check the inventory adjustment history on the variant prior to where the error happened.

 

Cheers,

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution