Order_date_from and order_date_to on shipments query

I’ve been working with filtering the shipments query by order_date_from and order_date_to, and I’m confused about what exactly those values refer to.

Their type is specified as ISODateTime, so I would expect them to be straight-up timestamps defining the boundaries of the query, but that doesn’t seem to be quite how they operate. In fact, requesting an order_date_from of 2020-08-03 00:00:00 and an order_date_to of 2020-08-04 00:00:00 gets me shipments whose order dates range from 2020-08-03T20:47:37+00:00 to 2020-08-04T23:09:48+00:00.

For reference, this is the query I’m using:

query getShipments($cursor: String) {
    shipments(order_date_from: "2020-08-03 00:00:00", order_date_to: "2020-08-04 00:00:00") {
        data(after: $cursor) {
            pageInfo {
                hasNextPage
                endCursor
            }
            edges {
                node {
                    id
                    order_id
                    created_date
                    order {
                        id
                        order_date
                    }
                }
            }
        }
    }
}

After paginating through all of the results from that query, the value of order.order_date ranges as I mentioned above.

I thought at first that the parameter might be treated as a simple date which is exclusive on the from and inclusive on the to, but that doesn’t quite make sense with the results I’m seeing, as that wouldn’t return any shipments with a date of 2020-08-03.

Hi @jfmontanaro!
I think I understand what you are saying, but is there any chance you could send me the request_id you are getting back?
That way I could go into the account and check the shipments info + order dates and get a better picture.
Thanks in advance!
Tom

Hi Tomas! I made two requests, one for the first page of 100 items and one for the last page. That way we should get a good spread of order_date values.

Request ID for the first page is: 5f377f061d324c7a3f098e70
Request ID for the last page is: 5f378215a94a76ebbb414d55

Thanks for the information @jfmontanaro!
Are you looking to filter by shipment date, or using the date in which the order was created?

shipment date: date_from + date_to
order date: order_date_from + order_date_to

I’m trying to use the date the order was created. I’m syncing two sets of data, and on the one side I’m pulling by order date, so I’d like to pull by order date on both sides so that I’m comparing apples-to-apples.

Hi @jfmontanaro
Thanks for clarifying that!
I know what you mean, it looks like there is a significant inconsistency between the start and end data that should be filtered.
This was already escalated to our Engineering team for a fix.
I will let you know as soon as I have an update.
Thanks again for the explanation while I figured this out!
Tom