Skip to main content

The automaticDiscounts query is removed in API version 2027-01

The deprecated automaticDiscounts query is removed from the GraphQL Admin API in version 2027-01. If your app reads a shop’s automatic discounts through automaticDiscounts, you need to move to the discountNodes query with a method:automatic filter before you upgrade to 2027-01. Apps on 2026-10 and earlier keep working unchanged while those versions are supported.

What changed

As of API version 2027-01, automaticDiscounts no longer exists on QueryRoot. Requests that include automaticDiscounts on 2027-01 return a validation error instead of data. The DiscountAutomaticConnection and DiscountAutomaticEdge types are also removed, because no other fields in the schema return them.

Use discountNodes instead, with query: "method:automatic". It returns a connection of DiscountNode objects, each exposing the discount itself on the discount field. discountNodes accepts filters similar to the removed query, including status, discount_type, discount_class, created_at, and starts_at. For details on how to combine filters, see the Shopify API search syntax.


Note

The automaticDiscountNodes query is also deprecated in favor of discountNodes. If you migrate to automaticDiscountNodes, you’ll need to migrate again later when that query is removed.


You can call discountNodes to read both code-based and automatic discounts through one query, with a single filter vocabulary.

Who's affected

This removal affects any app that calls automaticDiscounts and requests API version 2027-01 or later, including apps pinned to unstable once 2027-01 is the latest version. It also affects tooling and generated types that reference DiscountAutomaticConnection or DiscountAutomaticEdge.

Apps that request 2026-10 or earlier continue to work as long as those versions are supported. Apps that already read automatic discounts through discountNodes don’t need to change anything. Apps that use automaticDiscountNodes aren’t affected by this specific removal, but should plan to move to discountNodes.

If your app doesn’t call automaticDiscounts, you don’t need to take action for this change.

Why this matters

discountNodes is one query surface for all discounts, automatic and code-based. You use the same search syntax and pagination pattern across discount types. If your app needs both methods, you read a single paginated list instead of merging separate query results, and new automatic discount types don’t require new query fields.

Breaking changes and migrations

When you request API version 2027-01 or later, any query that includes automaticDiscounts fails validation. Types that depend on DiscountAutomaticConnection or DiscountAutomaticEdge also break when you regenerate code against 2027-01.

To migrate:

  1. Search your app for automaticDiscounts, including generated GraphQL types and any references to DiscountAutomaticConnection or DiscountAutomaticEdge.
  2. Replace the query with discountNodes and pass query: "method:automatic". Move your existing inline fragments one level deeper, onto the discount field of DiscountNode.
  3. Regenerate your GraphQL types or schema snapshot against 2027-01 so your types match the new shape.
  4. Test against 2027-01 in a development store and confirm that the results match what your app returned on 2026-10.

Here’s the same request, before and after:

# Before, on 2026-10 and earlier
query {
automaticDiscounts(first: 10) {
nodes {
... on DiscountAutomaticBxgy {
title
status
}
}
}
}

# After, on 2027-01
query {
discountNodes(first: 10, query: "method:automatic") {
nodes {
id
discount {
... on DiscountAutomaticBxgy {
title
status
}
}
}
}
}

The inline fragments carry over unchanged. You move them from the nodes under automaticDiscounts to the discount field of each DiscountNode. If your app reads more than one automatic discount type, add one inline fragment per type on discount, or select shared fields through the interfaces those types implement.

If you can’t migrate before 2027-01, keep your app on 2026-10 or an earlier supported version that still includes automaticDiscounts until you complete the change.

Action required

Before you upgrade your app to API version 2027-01, update any queries that call automaticDiscounts to use discountNodes with query: "method:automatic", and regenerate your types against 2027-01. If you upgrade without migrating, those queries return validation errors and your app no longer reads automatic discounts.

You can confirm the migration worked by running your updated queries against a development store on 2027-01 and checking that the automatic discount data matches what you saw on 2026-10.

If your app doesn’t call automaticDiscounts, you can upgrade to 2027-01 without changes.

Related docs

Was this page helpful?