Metafield Definition Capability Framework and Deprecation of use_as_collection_condition
API
Effective September 20, 2024
Action required
As of API version 2024-10, we're introducing the Metafield Definition Capability Framework and deprecating the use_as_collection_condition
field on the Metafield Definition object. The new smart_collection_condition
capability will replace the deprecated field, providing a more flexible and extensible way to manage metafield behaviors in smart collections.
What's changing?
- The
use_as_collection_condition
field on Metafield Definitions is being deprecated. - A new
smart_collection_condition
capability is being introduced as part of the Metafield Definition Capability Framework.
Why it matters
The new Capability Framework offers several benefits:
- Improved flexibility: Capabilities can be easily added, removed, or modified without changing the core Metafield Definition structure.
- Better extensibility: New capabilities can be introduced in the future without affecting existing implementations.
- Clearer semantics: Capabilities provide a more explicit way to define metafield behaviors.
How to update
To prepare for this change, update your API calls and app logic as follows:
- Instead of setting
use_as_collection_condition: true
, use:
capabilities: {
smartCollectionCondition: {
enabled: true
}
}
- When querying metafield definitions, check the
smart_collection_condition
capability instead of theuse_as_collection_condition
field:
query {
metafieldDefinition(id: "gid://shopify/MetafieldDefinition/1234") {
capabilities {
smartCollectionCondition {
enabled
}
}
}
}
Timeline
- API version 2024-10: The new capability is available, and
use_as_collection_condition
is deprecated but still functional. - Future version: The
use_as_collection_condition
field will be removed entirely.
We recommend updating your integrations to use the new capability as soon as possible to ensure a smooth transition.
Learn more about metafield capabilities at Shopify.dev Learn more about the Metafield Definition Capability Framework at Shopify.dev.