I have a GraphQL (url=api/2024-01/graphql.json) query (see below) for orders.
The query returns orders starting on
“createdAt”: “2024-04-09T16:01:09Z”, which is 31h before the date time I specified in the query.
{
query {
orders(first: 250, query: "created_at:>2024-04-10T23:00:00Z, finacial_status:PAID") {
edges {
node {
name
createdAt
processedAt
lineItems (first: 250) {
edges {
node {
quantity
discountedTotalSet {
shopMoney {
amount
}
}
sku
customAttributes {
key
value
}
}
}
}
customer {
metafield(key:"${flybuysNumberKey}", namespace:"custom") {
namespace
key
value
}
}
}
}
}
}
}
If I switch the date to 11th April, i get orders on the 10th at 4pm, 31h before the query date. Adding single quotes around the iso time returns zero results. If I remove the time part of the date and have “created_at:>2024-04-10” I get the same result as when the time was 23:00:00. In other words the query seems to ignore the timestamp and grab orders from the day before. It is not completely ignoring created_at. Our timezone is Australia Melbourne +10h. Shopify admin shows the orders in our TZ, but the GraphQL response data is in UTC; I don’t think a TZ mis-understanding is the cause of the problem.
How can i write a query that will only return orders in the exact timestamp that i specify?
This issue is quite serious, I can’t get a reliable set of orders in a specific time period to integrate reporting data with a partner. I am using Postman and Node.js.