Admin GraphQL API / Breaking Change2026-07

DraftOrderLineItem's grams is being removed
Going forward, rewrite to weight(value + unit)

The integer field on draft order line items, which has been deprecated for over 8 years, grams will be removed in API version 2026-07. Use the weight field instead, which returns both a value and a unit. Once 2026-04 falls out of support, queries referencing grams will error out.

On this page
  1. Understand in 30 seconds: What's changing
  2. Timeline visual: When it stops working
  3. Before / After: Rewriting your query
  4. Comparing grams and weight
  5. Why the change was made
  6. Migration steps (3 steps)
  7. 5 key points for engineers
  8. 3 use cases for your business
  9. One-line summary for proposals

1Understand in 30 seconds: What's changing

The Admin GraphQL API's DraftOrderLineItem(draft order line item) is having its integer field grams removed in the 2026-07 version.
The fix is simple:grams just rewrite references to weight { value unit } to use weight. weight returns both a 'value' and a 'unit'.
grams

Before: grams

Returns weight as a single 'integer in grams'. Deprecated more than 8 years ago. Has no concept of units and risked overflow for heavy items.

Going forward: weight

valueandunitreturned as a pair. Can express units other than grams, and is consistent with other weight representations across the platform.

The scope of impact is limited to DraftOrderLineItem.grams.The article only mentions the removal of this field; there is no mention of grams or weight specifications on other objects.

2Timeline visual: When it stops working

More than 8 years ago grams is Deprecated 2026-04 Last version where grams is usable 2026-07 grams removed (not available from this version) 2026-04 becomes unsupported grams reference queries return an error
"Removal" and "returns an error" happen at different times. grams will be gone starting 2026-07. However, for apps that keep using 2026-04, at the point when 2026-04 becomes unsupportedgrams reference queries will start returning errors. In other words, "pinning to an old version to extend the lifespan" only buys you a little more time — once the support deadline arrives, it will stop working for sure.

3Before / After: rewriting the query

Before (being deprecated)
draftOrder(id: "gid://shopify/DraftOrder/1") {
 lineItems(first: 5) {
 nodes {
 grams # ← 2026-07 で消える
 }
 }
}
After (recommended)
draftOrder(id: "gid://shopify/DraftOrder/1") {
 lineItems(first: 5) {
 nodes {
 weight {
 value
 unit
 }
 }
 }
}
Note that the shape of the response changes. The old grams just returns a single number, while the new weight is an { value, unit } object.Code that used the integer value of grams directly in calculations will need to add logic that reads the unit and converts accordingly.A simple field-name swap is not always enough.

4grams vs. weight

Itemgrams (old, deprecated)weight (new, recommended)
Type Scalar A single integer (Int) Object value + unit
Unit Fixed to grams (no unit concept) Explicit via unit (g / kg / oz / lb, etc.)
Behavior with heavy weights Risk of overflow Can be expressed in larger units, so it's safe
Consistency across the platform Unique to this field Unified Same approach as other weight representations
Status Deprecated over 8 years ago → removed in 2026-07 Current recommended field

5Why the change

99999...

Single unit & overflow problem

grams can only handle one unit—grams—and large weights risked overflow.

Flexible & consistent with WeightInput

weight uses WeightInput, which has value and unit . This makes it consistent with how weight is handled elsewhere on the platform, and more flexible.

6Migration steps (3 steps)

1

Find all references to grams

Do a full-text search of your codebase and saved queries for grams . Targets are anywhere you read DraftOrderLineItem line items.

2

Replace with weight { value unit }

Rewrite the queries, and update the response-side parsing to read both value and unit. Add unit conversion to any calculations that used the number alone.

3

Verify during 2026-04

Confirm behavior with the new query before support ends. If everything checks out, you can safely move up to 2026-07.

For details, see the DraftOrderLineItem reference docs. For questions, ask in the Shopify Partners community.

75 key points for developers

07

1. Removal starts in 2026-07

grams is gone as of the 2026-07 version. It still exists in earlier versions, but don't use it in new implementations.

SUNSET

2. The trigger is the version's end of support

Errors begin the moment 2026-04 goes out of support. Pinning a version is only a stopgap—once the deadline hits, it will definitely stop working.

3. The type changes from scalar to object

grams is a single integer. weight is { value, unit }. Both the query nesting and the response parsing change in structure.

g→kg

4. A simple rename isn't enough for calculations

If you used the grams integer directly in shipping calculations or the like, you need logic that checks unit and converts. Just swapping the field name shifts the meaning of the value.

5. The design philosophy is "consistency across the platform"

weight uses WeightInput (value + unit), aligning with how weight is represented elsewhere in Shopify. The assumption going forward is that single-unit legacy fields like grams will be phased out, souse weight from the start in new code—that's the safe path.

8Three practical use cases for your work

grams grams grams
USE CASE 1

Audit existing integrations that reference grams and migrate them in bulk

Problem
Order, fulfillment, and inventory sync batches and external WMS systems reference DraftOrderLineItem.grams, creating a risk that production breaks when support ends in 2026-04.
Action
Do a full-text search across repositories and saved queries for grams , then replace the affected spots with weight { value unit } , and verify behavior in staging.
Outcome
You can prevent a sudden "query error out of nowhere" when the support deadline hits, and migrate on a planned schedule.
Technical notes
Because weight returns value plus unit, add unit-conversion logic to any code that previously used the number alone.
kg lb
USE CASE 2

Improve weight data accuracy for heavy or multi-unit products

Problem
For heavyweight goods like furniture, industrial equipment, or bulk lots, grams (an integer in a single unit) can overflow or cause unit mix-ups.
Action
Migrate to weight and handle value and unit as a pair. Respect unit when computing display and shipping rates.
Outcome
Weight data becomes accurate together with its unit, reducing mistakes in shipping cost, packaging, and delivery class decisions.
Technical notes
Since weight is freed from the single-unit constraint, large weights can be represented safely (resolving the overflow concern noted in the article).
deprecated! removed OK
USE CASE 3

Make detection of deprecated fields a standing practice (so this is the last time)

Problem
The pattern of "deprecated 8 years ago, then removed one day" — like grams — will keep happening. We scramble every time.
Action
Use this migration as a trigger to standardize an API-version pinning policy and ongoing monitoring of deprecated fields and support deadlines.
Outcome
You can catch future breaking changes early and switch from emergency response to planned migration.
Technical notes
Build Changelog tracking and deprecation checks for fields in use into your operations. Use the recommended field (weight) from the start for new implementations.

9One-line summary you can use in proposals

"DraftOrderLineItem's grams will be removed in 2026-07.
weight { value unit } rewriting to it makes you robust against overflow and brings unit awareness.
It's safer to audit grams references and migrate before support ends in 2026-04."