Inventory Available Qty Different in GraphQL and REST API

I’m migrating from the REST API to the GraphQL API. Currently working on the downloading of Inventory Levels for a specified location. For the same Location ID I get the following in the REST API for an individual inventory level:

{
			"admin_graphql_api_id" : "gid://shopify/InventoryLevel/35386890?inventory_item_id=27617479562",
			"available" : null,
			"inventory_item_id" : 27617479562,
			"location_id" : 41491594,
			"updated_at" : "2017-07-13T21:31:40+10:00"
		}

For the GraphQL API I get the following:

{
                        "id": "gid://shopify/InventoryLevel/35386890?inventory_item_id=27617479562",
                        "createdAt": "2017-03-05T03:40:02Z",
                        "updatedAt": "2017-07-13T11:31:40Z",
                        "item": {
                            "id": "gid://shopify/InventoryItem/27617479562",
                            "tracked": false
                        },
                        "location": {
                            "id": "gid://shopify/Location/41491594"
                        },
                        "quantities": [
                            {
                                "name": "available",
                                "quantity": 1
                            }
                        ]
                    }

I’m getting ‘null’ for the available qty in the REST API and 1 for the GraphQL API for the same inventory item ID. I haven’t been able to find a reason for the discrepancy here so far?

Hi @Andrew_Duncan,

I can confirm this is actually expected behaviour here, as the REST documentation specifies that the InventoryLevel.available field returns null if inventory tracking is disabled.

This behaviour is not the same on the GraphQL Admin API, as the inventoryLevel.quantities connector will show the amounts of all item states, including available, depending on what inventory state you’re requesting with the name argument. Additionally on the GraphQL API you can see if the item inventory tracking is disabled through the inventoryItem.item.tracked field instead.