Skip to main content
Back to changelog

Four additional topics are now available for Events

Apps can now subscribe to events for Metaobject, MetafieldDefinition, MetaobjectDefinition, and InventoryTransfer. Apps can also subscribe to targeted metafield changes on InventoryTransfer.

By subscribing to these topics, your app can react directly to changes in custom content, custom data definitions, and inventory transfer workflows. Apps can target the fields that matter in triggers, query the resource that changed, and avoid subscribing to broader updates just to diff payloads in their event handler.

For example, the following subscription delivers when the value of the title field changes. The query uses the trigger's metaobjectId to fetch that Metaobject and field.

[events]
api_version = "unstable"

[[events.subscription]]
handle = "metaobject-event"
topic = "Metaobject"
actions = ["update"]
triggers = [
"metaobject(type: 'books').field(key: 'title').value"
]

uri = "/api/events"

query = """
query MetaobjectTitleValue($metaobjectId: ID!, $fieldKey: String!) {
metaobject(id: $metaobjectId) {
id
type
handle
field(key: $fieldKey) {
key
value
}
}
}
"""

The complete payload body when the title field changes is as follows:

{
"topic": "Metaobject",
"action": "update",
"handle": "metaobject-title-value",
"data": {
"metaobject": {
"id": "gid://shopify/Metaobject/123123",
"type": "books",
"handle": "metaobject-event",
"field": {
"key": "title",
"value": "My Book Title"
}
}
},
"fields_changed": [
"metaobject[id: 'gid://shopify/Metaobject/123123', type: 'books'].field[key: 'title'].value"
],
"query_variables": {
"metaobjectId": "gid://shopify/Metaobject/123123",
"metaobjectType": "books",
"fieldKey": "title"
}
}

Events remain available in the unstable API version during developer preview. For topics that are not supported yet, continue using webhooks alongside Events.

Learn more about:

Was this page helpful?