GraphQL ignores time in query on created_at

Highlighted
New Member
4 0 0

When I query my orders using the created_at field (which, supposedly, is supported) I get unexpected results.  It looks like the time information in the DateTime field is ignored.  In other words: yyyy-mm-ddTxx:xx:xxZ is interpreted as yyyy-mm-ddT00:00:00Z or yyyy-mm-ddT23:59:59Z for whatever value of xx:xx:xx (depending on the < or < information?).

Hence the query operates on the date only and moreover it uses the date values in UTC at Greenwich.  This can lead to serious reporting issues.

 

Example below (The query should not return anything in my test store, but it returns an order outside the specified range)

 

 

{
orders(first:20, query:"created_at:>2019-12-10T00:00:00Z AND created_at:<2019-12-11T00:00:00Z") {
edges {
node {
name
createdAt}}}}

 

Returns:

... "node": {
"name": "#1006",
"createdAt": "2019-12-11T03:05:12Z"
}

0 Likes
Shopify Staff
Shopify Staff
33 6 4

Hi @Jheroen

 

We are aware that this is currently an issue and are actively working on a solution. I'll report back to you with updates shortly.

 

0 Likes