Best way to pull latest inventory from store

Hi, I am using REST with filter location id and last update to pull latest inventory for items like /inventory_levels.json?location_ids=locationId&updated_at_min=lastDateTime

Now I want to perform same in GraphQL. Could you let me know best way to perform this with minimum API calls.

I tried below with Graph QL but its not providing me all updated QTYs. I am getting mismatch data when I run exact same filters on REST like REST sends me 50 records and GraphQL sends me 2.

{ inventoryItems( first: 100 after: null query: “updated_at:>2025-04-01”) { pageInfo { endCursor hasNextPage } nodes { createdAt id inventoryHistoryUrl legacyResourceId sku updatedAt harmonizedSystemCode countryCodeOfOrigin unitCost { amount currencyCode } inventoryLevel(locationId: “gid://shopify/Location/33068351570”) { createdAt id updatedAt quantities(names: “available”) { id name quantity updatedAt } } } } }

Hey,

Query the location then the quantity (Location > Quantity), I always find it easier going from the top down (if that makes sense).

you have the concept right but the wrong way around (I think). but there is several ways to skin a catch.

You can max 250 per request, I would paginate the request (request cost is like ~40 and takes ~500ms and then store in a database like bigquery, using the updatedAt to write new things in and trigger updates.

Try this is postman

query Location {
    location(id: "gid://shopify/Location/XXXXXXXXXX") {
        inventoryLevels(first: 250) {
            nodes {
                item {
                    id
                    legacyResourceId
                    updatedAt
                    sku
                    harmonizedSystemCode
                    countryCodeOfOrigin
                    unitCost {
                        amount
                        currencyCode
                    }
                }
                quantities(names: "available") {
                    updatedAt
                    quantity
                }
            }
        }
    }
}