GraphQL unexpected created_at results

Highlighted
New Member
1 0 0

Hi there,

 

I am finding that I am receiving unusual results when searching products through GraphQL using the created_at query whereby I am receiving results "older" than my query.

 

For example I am using the following query for creating a report of products created by our team in a period.

{
   products(first: 25, query: "created_at:>=2019-09-15T23:18:16Z") {
    edges {
                node {
                    id
                    title
                    createdAt
                 }
        }
   }
}

Problem is that I am receiving a few results from before the created_at date, for example from the query above:

2019-09-15T23:01:05 <- this shouldn't be there

2019-09-15T23:11:15 <- this shouldn't be there

2019-09-15T23:15:25 <- this shouldn't be there

2019-09-15T23:18:16

2019-09-15T23:26:36

...

It is always the same regardless of the date in the created_at query, the results I am looking for are always there, but so are about 3 of 4 results from before the datetime in my query which makes my reports inaccurate to a degree,

 

Is there something I am missing with the GraphQL query and the create_at, or is this a bug?

 

Thanks in advance.

 

0 Likes
Shopify Staff
Shopify Staff
1546 77 231

Hey @JasonWeise.

 

Does it work better if you put quotes around the timestamp? I've found that the time is not respected unless you do that:

 

{
   products(first: 25, query: "created_at:>='2019-09-15T23:18:16Z'") {
    edges {
                node {
                    id
                    title
                    createdAt
                 }
        }
   }
}

Cheers.

0 Likes