I’m new to Shopify and trying to test some functionality.
I’m trying to get orders updated after a certain date time using GraphQL.
I can then use the last updated time as a start point next time round.
My problem is updated_at:> does not appear to work for me.
It gives the same reply as updated_at:>=
whereas created_at:> does work as expected.
Example
{
orders(
first: 5
sortKey: UPDATED_AT
query: “updated_at:>‘2025-06-26T12:03:48Z’”
) {
nodes {
id
updatedAt
createdAt
}
}
}
Will include orders updated at 12:03:48 (Same as >=)
The order data will be stored in UTC so worth checking there are orders updated in your time frame.
You also shouldn’t need to wrap your date in single quotes.
Lastly it’s worth considering this could return a lot of orders and take a long time to paginate through.
I would consider looking at webhooks or bulk queries as alternatives
If I run the query without the single quotes, the query gets parsed to
“range_gt”: “2025-06-26T00:00:00-04:00”
with a warning “Invalid search field for this query.”
As per my original post, it does appear to work fine with created_at where > will give a different response to >=
The amount of orders is not a concern at the moment, I just want to poll a store (every 15 mins or so) to see if there are any updates.
So, we figured this out.
The dates are held as datetime including milliseconds, even if the query does not return the milliseconds
You can add milliseconds to the query and get different results
updated_at:>‘2025-06-26T12:03:48Z’ will give 2 orders with updated time = 2025-06-26T12:03:48Z
updated_at:>‘2025-06-26T12:03:48.800Z’ will give 2 orders with updated time = 2025-06-26T12:03:48Z
updated_at:>‘2025-06-26T12:03:48.900Z’ will give only 1 order with updated time = 2025-06-26T12:03:48Z
updated_at:>‘2025-06-26T12:03:48.997Z’ will give NO orders with updated time = 2025-06-26T12:03:48Z