LineItem.weight isFrom GraphQL Admin API 2026-07 onward, the weight of an order line item (LineItem) can be queried directly as a Weight object (value + unit). No more manually converting units from the REST grams field.
LineItem you can now query the weight field on the type.grams field.
The REST Admin API returns line item weight as an integer in grams (grams). If you wanted to work in kg or lb, you had to divide and label the unit yourself.
On the GraphQL Admin API from 2026-07 onward, weight { value unit } can be queried as-is. The value and unit are returned together, so conversion code is no longer needed.
The numeric portion of the weight. Only meaningful when paired with a unit.
The unit portion of the weight. Returned together with the value, so there's no need to guess the unit separately when displaying or computing.
weight it's clarified that it's a Weight object with value and unit.The specific values (enum) that unit can take are not listed.When implementing, check the API schema (GraphQL's Weight / WeightUnit).| Item | Before: REST Admin API | After: GraphQL Admin API (from 2026-07) |
|---|---|---|
| Target field | LineItem's grams |
LineItem's weight |
| Return shape | Scalar Integer in grams | Object Weight(value + unit) |
| Unit handling | Always fixed to grams; convert other units yourself | Unit is returned together as `unit` |
| Conversion code | Required | Not required |
| Available versions | Same as before | GraphQL Admin API 2026-07 and later |
* For REST, grams The article does not mention availability or deprecation (not stated). It only conveys that this is now usable on the GraphQL side. weight is now available.
A representative query built from the field name (LineItem.weight → Weight { value unit }) mentioned in the article. Check the API schema for the actual field structure.
This weight field is available from GraphQL Admin API version 2026-07. Clients targeting earlier versions cannot query it.
Not a scalar but Weight an object.value and unit are each retrieved as subfields.
From REST's grams you can remove the boilerplate that manually converted to kg/lb, etc. It also prevents unit mix-up bugs.
You can retrieve the weight per order line item rather than for the entire order. A granularity that can be used directly for per-line-item shipping and fee calculations.
Code that previously kept REST around just to fetch weight can now be handled entirely with GraphQL.The specific values that unit can take are not listed in the article, so when migrating, check the GraphQL schema's Weight / WeightUnit before implementing.
grams fetched the value and manually converted it to kg/lb for shipping calculations. Conversion logic was scattered across the codebase, becoming a hotbed for bugs.LineItem.weight { value unit } to retrieve the value and unit as-is.weight adopt the value/unit directly as relay data.weight.value / weight.unit directly via ETL.