Skip to main content

Timestamp filters match whole seconds

Starting in API version 2027-01, timestamp filters in the GraphQL Admin API treat values without fractional seconds, such as created_at:<'2026-09-15T12:00:02Z', as referring to the whole second. If your app queries resources with timestamp filters, then review any logic that depends on inclusive or exclusive boundary comparisons before you update to 2027-01.

What changed

The GraphQL Admin API returns timestamps such as createdAt to the second, but some resources store timestamps with fractional seconds.

Before 2027-01, the same filter syntax behaved differently depending on the resource:

  • On some resources, such as orders, :<'T' also returned records from later in the second T, and :<='2026-09-15T12:00:02.000Z' returned records from the full second starting at 12:00:02Z.
  • On other resources, :<='T' and :>'T' compared against the start of the second T. In those cases, :<='T' didn't return a record created later in that second, while :>'T' did.

Starting in 2027-01, a filter value without fractional seconds always represents the full second that the API returns. The following table shows how each comparator matches records for a whole-second timestamp T:

FilterMatched timestamps
:<'T'Before the second T
:<='T'In or before the second T
:>'T'After the second T
:>='T'In or after the second T

Shopify compares filter values that include fractional seconds, such as 2026-09-15T12:00:02.000Z, exactly as written.

Who's affected

This change applies to apps that query the GraphQL Admin API with timestamp filters on API version 2027-01 or later. It affects queries on timestamp fields such as createdAt that use filter strings such as created_at:<'T' or created_at:>='T' without fractional seconds.

Before 2027-01, adjacent time windows and inclusive comparisons could behave differently across resources, which could cause apps to miss or double-count records at second boundaries.

What to do

Before you update your app to 2027-01, update and test your timestamp filter logic:

  1. Review timestamp filters that use whole-second values such as 2026-09-15T12:00:02Z or rely on inclusive or exclusive boundary behavior.
  2. Pair adjacent time windows with :>= and :<, such as created_at:>='A' created_at:<'B' followed by created_at:>='B' created_at:<'C'. Ending one window with :<'B' and starting the next with :>'B' skips every record created during the second B.
  3. Omit fractional seconds when you want a filter to match the whole second, such as 2026-09-15T12:00:02Z. Shopify compares values with fractional seconds, including .000Z from JavaScript's .toISOString(), exactly as written.

The following query fetches orders created within a five-minute window using whole-second timestamps:

query OrdersInWindow {
orders(
first: 50
sortKey: CREATED_AT
query: "created_at:>='2026-09-15T12:00:00Z' created_at:<'2026-09-15T12:05:00Z'"
) {
nodes {
id
createdAt
}
}
}

This query returns orders whose createdAt timestamp falls in or after 2026-09-15T12:00:00Z and before 2026-09-15T12:05:00Z, with no gaps or overlap at the second boundaries.

Related docs

For full details on query comparators and filter grammar, see Shopify API search syntax.

Was this page helpful?