Capabilities provide a way to mix in behaviors and logic with your metaobjects. When you create a metaobject definition, you can enable
capabilities that provide additional behavior. You can enable the following capabilities:
- publishable: Enable drafting of metaobjects using a
statuscolumn either set to
- translatable: Make your metaobjects translatable through Shopify's translation APIs.
Draft custom contentAnchor link to section titled "Draft custom content"
publishable capability enables users of your metaobject to set it's status to either
ACTIVE. This can be useful for providing merchants a way to stage their content before making it available to their storefronts - even if you defined it to be available to storefronts using access controls.
In the following, the
metaobjectDefinitionCreate mutation is called with
publishable set to
true to enable this capability:
Next, using the
metaobjectCreate mutation, you'll notice that the default status for a created "Custom Article" metaobject is
To publish the custom article metaobject, you can use the
metaobjectUpdate mutation and set the status to
Make your metaobjects translatableAnchor link to section titled "Make your metaobjects translatable"
translatable capability allows the fields of a metaobject to be translated. You can be enable this capability by setting
true when performing a
translatable has been enabled, you can use Shopify's translation APIs to register translations for fields on your metaobjects. For the "Custom Article" metaobject, you'll first need to retrieve the fields that can be translated through the
Then, you can register translations for any of the fields on the metaobject. For example, you can translate the
title field by passing in the metaobject ID and using the
digest for the