GraphQL ignores time in query on created_at

Highlighted
Shopify Partner
5 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
Highlighted
Shopify Staff
Shopify Staff
51 10 5

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
Highlighted
Shopify Partner
2 0 1

Is this bug fixed already?

 


@sd_ wrote:

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.

 



?

1 Like
Highlighted
New Member
1 0 0

Is this was fixed already?

0 Likes
Highlighted
Shopify Partner
541 39 110

Apparently this is still an issue. In the GraphQL API. Screen shots below. Although you can use query parameters for created_at timestamp ranges and get results just fine in the REST API. For example, https://{my_shop}.myshopify.com/admin/api/2020-07/orders.json?created_at_min=2020-07-08T17:00:00&created_at_max=2020-07-08T17:59:59

Been awhile that it's been a known bug?

orders by timestamp.jpg 

0 Likes