GraphQL API does not have UnitPriceMeasurement Field

I want to read and write to the unitPriceMeasurement for each variant. Regarding the Shopify GraphQL docs, this field should be available (UnitPriceMeasurement). We are a german based store.

This is my GraphQL query:

    {
        productVariants(first: 100) {
          nodes {
            title,
            unitPriceMeasurement {
                quantityValue
            }
          }
        }
      }

This is the error which occurs:

{"errors":[{"message":"Field 'unitPriceMeasurement' doesn't exist on type 'ProductVariant'","locations":[{"line":6,"column":13}],"path":["query","productVariants","nodes","unitPriceMeasurement"],"extensions":{"code":"undefinedField","typeName":"ProductVariant","fieldName":"unitPriceMeasurement"}}]}

Is there anything wrong with my query? How can I access the unitPriceMeasurement?

Hey @KevinSchade - thanks for getting in touch. unitPriceMeasurement is only available on the ProductVariants object when you’re querying the storefront API. This error often pops up if you’re attempting to query the field using the Admin API.

Hope this helps!

Hey, thanks for your reply! Is there any way to edit/mutate the UnitPriceMeasurement via an API?

Do we have to do this manually?

Hi KevinSchade,

Currently there is not a way to set UnitPriceMeasurement via API, it can only be set in the web admin under the variant options where the fields appear only if the store is located in Germany or France. Related public docs: [Setting Unit Price - Shopify Docs]