ShopifyQL OFFSET stopped working for query with COMPARE TO

I’m querying data via ShopifyQL through the GraphQL Admin API.

Previously, using LIMIT and OFFSET worked correctly for pagination. However, as of today, when my query includes COMPARE TO previous_year_match_day_of_week, the API keeps returning the same first 1000 rows and ignores OFFSET, causing an infinite loop.

I tried with other COMPARE TO option, none worked with OFFSET.

When I remove COMPARE TO, pagination works as expected.

Example query:

FROM sales

SHOW net_items_sold, net_sales

WHERE line_type = ‘product’

AND product_variant_sku IS NOT NULL

GROUP BY product_variant_sku

SINCE 2026-02-08 UNTIL 2026-02-14

COMPARE TO previous_year_match_day_of_week

ORDER BY net_items_sold DESC

Questions:

Is this a confirmed bug?

What is the recommended long-term approach for paginating large ShopifyQL datasets?

Thanks!

Hey @Vivian_J - I was able to reproduce this on a test store. Running the same shopifyqlQuery with LIMIT 5 OFFSET 0 and LIMIT 5 OFFSET 5 returns identical rows when COMPARE TO is present. Removing COMPARE TO from the query and OFFSET behaves correctly, so this is definitely isolated to the interaction between those two keywords.

Your syntax is fine and matches the documented LIMIT/OFFSET pattern. I’m raising this with the relevant team for investigation. I’ll update this thread once I hear back.

The only workaround I can offer in the meantime is to drop COMPARE TO from your paginated queries and run the comparison period as a separate query. Not ideal, but it should unblock the pagination loop.

Thanks for reporting this!

1 Like

Hey @Vivian_J

Thanks again for reporting the issue with OFFSET and its interaction with COMPARE TO. It’s been resolved and you should get back the OFFSET’d rows as expected, even when COMPARE TO is present in the query.

Have a great day!

2 Likes