GraphQL BUG: inventoryItems query parameter gives wrong result when quering the `updated_at` field

Topic summary

A bug was reported where the inventoryItems GraphQL query parameter incorrectly handles the updated_at field when using the :>= (greater than or equal) operator.

Issue Details:

  • The date portion of the datetime string is processed correctly
  • The time portion is ignored, causing all queries between 2023-04-14T00:00:00Z and 2023-04-14T23:59:59Z to return identical results
  • A screenshot was provided demonstrating the problem

Resolution:

  • Shopify Developer Support confirmed the issue and provided a workaround
  • Solution: Enclose the datetime value in single quotes (') within the query parameter
  • Example: query: "updated_at:>='2023-04-14T23:59:59Z'"
  • This ensures the timestamp is processed correctly based on the full datetime value
  • Reference documentation on search syntax was provided for additional context
Summarized with AI on November 21. AI used: claude-sonnet-4-5-20250929.

The GraphQL inventoryItem endpoint gives an incorrect result when the query parameter is used to query the updated_at field with a :> (= greater than or equal) operator.

More specifically, the date part of the date-time string is honoured, but the time part is ignored.

As a result, queries with date-time values of 2023-04-14T00:00:00Z and 2023-04-14T23:59:59Z (and anything in-between) all give the same result.

Hey @Jacco-V , thanks for getting in touch. This is a tricky one - definitely get where you’re coming from here. To resolve this issue, you can enclose the date-time value inside single quotes (') for the query parameter to work as expected. Here’s an example inventoryItems query with the updated_at value inside quotes:

query getInventoryBetween {
inventoryItems(first: 10, reverse: true, query: “updated_at:>=‘2023-04-14T23:59:59Z’”) {
nodes {
id
locationsCount
legacyResourceId
duplicateSkuCount
variant {
availableForSale
id
}
updatedAt
}
}
}

This would pull the record correctly based on the time stamp. There’s an example here in our dev docs on this that goes over search syntax - just including this here for reference.

Hope this helps - thanks again for getting in touch.

Al | Shopify Developer Support

1 Like