2021-07 API version release, the
value_type field on the
Metafield object was deprecated. As of the
2022-01 API version release, the
value_type field has been removed from these APIs.
- In the REST Admin API, the
typeproperty replaces the
value_typeproperty in the
- In the GraphQL Admin API, the
typefield replaces the
valueTypefield in the
This guide describes how you can migrate your metafields from using
type in the REST Admin API and GraphQL Admin API.
How it worksAnchor link to section titled "How it works"
For backward compatibility, when metafields that use the new types are queried from API version
2021-04 or earlier, we return a backward-mapped value type. For example, the
date type maps to the
STRING value type.
type attribute also accepts deprecated value types. You can update the field name and keep the same value to avoid breaking other integrations (such as Liquid in themes). However, when adding new metafields, we recommend using the new types.
Migrate your metafields in the REST Admin APIAnchor link to section titled "Migrate your metafields in the REST Admin API"
value_type property to
type in your
Metafield resource, as shown in the following example:
Migrate your metafields in the GraphQL Admin APIAnchor link to section titled "Migrate your metafields in the GraphQL Admin API"
valueType field to
type in your
Metafield object, as shown in the following example:
To learn more about using Shopify APIs to work with metafields, refer to the following documentation: