Skip to main content

DraftOrderLineItem.grams field removed in 2026-07

What's changing

We are removing the grams field from the DraftOrderLineItem object in the Admin GraphQL API, starting with version 2026-07. This field was deprecated over 8 years ago. After the 2026-04 API version becomes unsupported, any queries referencing DraftOrderLineItem.grams will return an error.

What you need to do

Replace any usage of grams with the weight field on DraftOrderLineItem. The weight field returns both a value and a unit, giving you more flexibility than the old grams integer.

Before (deprecated):

   draftOrder(id: "gid://shopify/DraftOrder/1") {
     lineItems(first: 5) {
       nodes {
         grams
       }
     }
   }
 }

After:

   draftOrder(id: "gid://shopify/DraftOrder/1") {
     lineItems(first: 5) {
       nodes {
         weight {
           value
           unit
         }
       }
     }
   }
 }

Why we made this change

The grams field only supported one unit and could overflow for large weights. The weight field uses a WeightInput with both value and unit, which is more flexible and consistent with how weight works elsewhere in the platform.

Need help?

For more details, see the DraftOrderLineItem reference docs. If you have questions about this change, please reach out through the Shopify Partners community.

Was this section helpful?