grams is being removedweight(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.
grams removed in the 2026-07 version.grams just rewrite references to weight { value unit } to use weight. weight returns both a 'value' and a 'unit'.
gramsReturns weight as a single 'integer in grams'. Deprecated more than 8 years ago. Has no concept of units and risked overflow for heavy items.
weightvalueandunitreturned as a pair. Can express units other than grams, and is consistent with other weight representations across the platform.
draftOrder(id: "gid://shopify/DraftOrder/1") { lineItems(first: 5) { nodes { grams # ← 2026-07 で消える } } }
draftOrder(id: "gid://shopify/DraftOrder/1") { lineItems(first: 5) { nodes { weight { value unit } } } }
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.
| Item | grams (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 |
grams can only handle one unit—grams—and large weights risked overflow.
weight uses WeightInput, which has value and unit . This makes it consistent with how weight is handled elsewhere on the platform, and more flexible.
Do a full-text search of your codebase and saved queries for grams . Targets are anywhere you read DraftOrderLineItem line items.
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.
Confirm behavior with the new query before support ends. If everything checks out, you can safely move up to 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.
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.
grams is a single integer. weight is { value, unit }. Both the query nesting and the response parsing change in structure.
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.
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.
grams , then replace the affected spots with weight { value unit } , and verify behavior in staging.weight { value unit } rewriting to it makes you robust against overflow and brings unit awareness.