Shopify just announced a breaking change for developers: the automaticDiscounts query is gone in API version 2027‑01. If your app relies on reading a shop’s automatic discounts, the next upgrade will throw validation errors unless you migrate to the new discountNodes query. This post breaks down the change, tells you who needs to act, and provides a clear migration path with code examples.
What Changed in API 2027‑01
In version 2027‑01 the automaticDiscounts field disappears from the GraphQL QueryRoot. The associated types—DiscountAutomaticConnection and DiscountAutomaticEdge—are also removed. Any request that still references automaticDiscounts now fails validation. Shopify replaced this niche query with the more versatile discountNodes query, which can be filtered with method:automatic to return only automatic discounts.
Who Is Affected?
automaticDiscounts or uses the deprecated GraphQL types will break once it targets 2027‑01 or later. This includes generated type files, SDK wrappers, and any tooling that introspects the schema.discountNodes (or never read automatic discounts) can upgrade to 2027‑01 without changes. Apps pinned to 2026‑10 or earlier continue to work as long as those versions remain supported.Why It Matters
discountNodes consolidates automatic and code‑based discounts under a single query surface. This simplifies pagination, search syntax, and future‑proofs your code against new discount types. By moving now, you avoid a hard break and gain a cleaner, more consistent API experience.
Step‑by‑Step Migration Guide
automaticDiscounts, DiscountAutomaticConnection or DiscountAutomaticEdge in your codebase, GraphQL fragments, and generated type files.discountNodes and add the filter query: "method:automatic".discount field of each DiscountNode.Before vs. After Example
graphql
# 2026‑10 (pre‑migration)
query {
automaticDiscounts(first: 10) {
nodes {
... on DiscountAutomaticBxgy {
title
status
}
}
}
}
graphql
# 2027‑01 (post‑migration)
query {
discountNodes(first: 10, query: "method:automatic") {
nodes {
id
discount {
... on DiscountAutomaticBxgy {
title
status
}
}
}
}
}
Notice how the inline fragment now lives under discount and each node also returns an id—useful for pagination and caching.
Testing & Validation Checklist
automaticDiscounts is absent.discountNodes query in a dev store and compare result counts with the old query.DiscountAutomaticBxgy) still compile after moving under discount.cursor/hasNextPage) works the same way as before.Action Required Summary
*If you call automaticDiscounts*: update the query to discountNodes with method:automatic, regenerate schema/types, and test on 2027‑01 before upgrading your app’s version.
*If you don’t*: you can safely move to 2027‑01 without any code changes.
*If you still need more time*: keep your app pinned to 2026‑10 (or an earlier supported version) until you complete the migration, but plan to upgrade soon because older versions will eventually be deprecated.
Conclusion & Next Steps
The removal of automaticDiscounts is a classic Shopify deprecation that pushes developers toward a unified discount API. By migrating now, you avoid service interruptions for merchants and unlock a simpler way to work with all discount types. Update your queries, regenerate your types, and run your tests today—then upgrade to API 2027‑01 with confidence.
Need help with the migration or want a code review? Drop a comment below or reach out on the Shopify Community Forums. Happy coding!
