Field 'measurement' doesn't exist on type 'InventoryItem'

Topic summary

A developer encountered an error stating that the ‘measurement’ field doesn’t exist on the InventoryItem type when querying product data.

Root Cause:
The issue stems from using API version 2023-10, where the ‘measurement’ field is no longer supported on InventoryItem.

Solution:
The developer resolved this by removing the ‘measurement’ field from their query and instead relying on the variant’s ‘weight’ and ‘weightUnit’ fields, which remain available in this API version.

Additional Context:
Another participant noted that when making API calls from extensions (Admin Actions, App Blocks), the API version may not default to settings in .toml files or partner dashboard. They recommend explicitly specifying the version number in the fetch URL (e.g., fetch("shopify:admin/api/2024-07/graphql.json")) rather than using the default URL to ensure consistent behavior and avoid relying on deprecated fields.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

Actually I end up removing it! I’m on version 2023-10, which this field is not supported, so I had to rely on variant weight and weigthUnit fields. Thanks