Admin Intents docs for Metaobjects are Misleading

This is related to Admin Intent documentation Metaobject Definitions has wrong params

I discovered couple more inconstancies. Admin Intents docs for Metaobjects and Metaobject Definition don’t describe the usage correctly.

  1. Edit MetaobjectDefinition Intent

Official Docs (WRONG):

const activity = await shopify.intents.invoke(
‘edit:shopify/MetaobjectDefinition’,
{ value: ‘gid://shopify/MetaobjectDefinition/123456789’ }
);

Correct Implementation:

const activity = await window.shopify.intents.invoke(
“edit:shopify/MetaobjectDefinition”,
{
data: { type: selectedDefinition }, // e.g., ‘shopify–color-pattern’
}
);

Difference: The official docs claim you need to pass a value with the GID of the metaobject definition. The correct implementation use
data: { type } instead, where type is the metaobject definition type string (e.g., ‘shopify–color-pattern’), not a GID.


  1. Edit Metaobject Intent

Official Docs (WRONG - Incomplete):

const activity = await shopify.intents.invoke(‘edit:shopify/Metaobject’, {
value: ‘gid://shopify/Metaobject/123456789’,
data: {type: ‘shopify–color-pattern’},
});

Correct Implementation:

const activity = await window.shopify.intents.invoke(
“edit:shopify/Metaobject”,
{
value: metaobject.id,              // GID of metaobject
data: { type: metaobjectType },    // REQUIRED type
}
);

Difference: The official docs show data: { type } in their table but their examples are inconsistent. The correct implementation requires BOTH value (the metaobject GID) AND data: { type } (the definition type).

Also faced by @farid


  1. Create MetaobjectDefinition Intent

Official Docs:

const activity = await shopify.intents.invoke(
‘create:shopify/MetaobjectDefinition’,
);

Correct Implementation:

const activity = await window.shopify.intents.invoke(
“create:shopify/MetaobjectDefinition”
);

Difference: None - both are correct. No additional parameters needed.


  1. Create Metaobject Intent

Official Docs (Correct):

const activity = await shopify.intents.invoke(‘create:shopify/Metaobject’, {
data: {type: ‘shopify–color-pattern’},
});

Correct Implementation

const activity = await window.shopify.intents.invoke(
“create:shopify/Metaobject”,
{
data: { type: selectedDefinition },
}
);

Difference: None - both are correct.


Summary Table

Intent Parameter Official Docs Your Code Status
edit:shopify/MetaobjectDefinition Required :cross_mark: value: GID :white_check_mark: data: { type } Docs Wrong
edit:shopify/Metaobject Required :warning: Shows value OR data :white_check_mark: value: GID + data: { type } Docs Incomplete
create:shopify/MetaobjectDefinition Required :white_check_mark: None :white_check_mark: None Correct
create:shopify/Metaobject Required :white_check_mark: data: { type } :white_check_mark: data: { type } Correct

Critical Insight

The metaobject definition type (e.g., ‘shopify–color-pattern’) is ALWAYS required when working with metaobjects, even for edit operations. This makes sense because Shopify’s metaobject editor UI needs to know which definition schema to load for the editing interface.

The official Shopify docs are misleading/incorrect for the edit:shopify/MetaobjectDefinition intent pattern.

Hi @Taksh_Shah

Thanks for your feedback on this - really appreciate the detail here. I’ve connected with the admin intents team who will review and update.

1 Like