Metaobject
Requires access scope.
An instance of custom structured data defined by a . Metaobjects store reusable data that extends beyond Shopify's standard resources, such as product highlights, size charts, or custom content sections.
Each metaobject includes fields that match the field types and validation rules specified in its definition, which also determines the metaobject's capabilities, such as storefront visibility, publishing and translation support. Metafields can reference metaobjects to connect custom data with Product objects, Collection objects, and other Shopify resources.
Anchor to FieldsFields
- Anchor to capabilitiescapabilities•Metaobject
Capability Data! non-null Metaobject capabilities for this Metaobject.
- Anchor to createdAtcreated•Date
At Time! non-null When the object was created.
- Anchor to createdBycreated•App!
By non-null The app used to create the object.
- Anchor to createdByAppcreated•App!
By App non-null The app used to create the object.
- Anchor to createdByStaffcreated•Staff
By Staff Member The staff member who created the metaobject.
- Anchor to definitiondefinition•Metaobject
Definition! non-null The MetaobjectDefinition that models this object type.
- Anchor to displayNamedisplay•String!
Name non-null The preferred display name field value of the metaobject.
- Anchor to fieldfield•Metaobject
Field The field for an object key, or null if the key has no field definition.
- •String!required
The metaobject key to access.
Arguments
- •String!
- Anchor to fieldsfields•[Metaobject
Field!]! non-null All ordered fields of the metaobject with their definitions and values.
- Anchor to handlehandle•String!non-null
The unique handle of the object, useful as a custom ID.
- •ID!non-null
A globally-unique ID.
- Anchor to referencedByreferenced•Metafield
By Relation Connection! non-null List of back references metafields that belong to the resource.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to thumbnailFieldthumbnail•Metaobject
Field Field The recommended field to visually represent this metaobject. May be a file reference or color field.
- Anchor to typetype•String!non-null
The type of the metaobject.
- Anchor to updatedAtupdated•Date
At Time! non-null When the object was last updated.
Deprecated fields
- •App!non-nullDeprecated
- Anchor to staffMemberstaff•Staff
Member Member Deprecated
Anchor to QueriesQueries
- •query
Retrieves a single
Metaobjectby its global ID. Metaobjects store custom structured data based on defined schemas. The returned metaobject includes its fields with values, display name, handle, and associated metadata like update timestamps and capabilities.- •ID!required
The ID of the metaobject to return.
Arguments
- •ID!
- •query
Retrieves a
Metaobjectby its handle and type. Handles are unique identifiers within a metaobject type.- Anchor to handlehandle•Metaobject
Handle Input! required The identifier of the metaobject to return.
Arguments
- •query
Returns a paginated list of
Metaobjectentries for a specific type. Metaobjects are custom data structures that extend Shopify's data model with merchant or app-specific data types.Filter results using the query parameter with a search syntax for metaobject fields. Use
fields.{key}:{value}to filter by field values, supporting any field previously marked as filterable. Theparameter acceptsid,type,, orto control result ordering.Learn more about querying metaobjects by field value.
- Anchor to typetype•String!required
The type of the metaobjects to query.
- Anchor to sortKeysort•String
Key The key of a field to sort with. Supports "id", "type", "updated_at", and "display_name".
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
- Anchor to display_name•string
- Anchor to fields.{key}•mixed
Filters metaobject entries by field value. Format:
fields.{key}:{value}. Only fields marked as filterable in the metaobject definition can be used. Learn more about querying metaobjects by field value.fields.color:bluefields.on_sale:true- Anchor to handle•string
- Anchor to updated_at•time
Example:
Arguments
Anchor to MutationsMutations
- •mutation
Creates a metaobject entry based on an existing
. The type must match a definition that already exists in the shop.Specify field values using key-value pairs that correspond to the field definitions. The mutation generates a unique handle automatically if you don't provide one. You can also configure capabilities like publishable status to control the metaobject's visibility across channels.
Learn more about managing metaobjects.
- Anchor to metaobjectmetaobject•Metaobject
Create Input! required The parameters for the metaobject to create.
Arguments
- •mutation
Creates up to 25 metaobjects of the same type.
- Anchor to inputinput•Metaobjects
Create Input! required The parameters for the metaobjects to create.
Arguments
- •mutation
Updates a
Metaobjectwith new field values, handle, or capabilities. Metaobjects are custom data structures that extend Shopify's data model.You can modify field values mapped to the metaobject's
, update the handle for a unique identifier, and adjust capabilities like publishing status. When updating the handle, you can optionally create a redirect from the old handle to maintain existing references.- •ID!required
The ID of the metaobject to update.
- Anchor to metaobjectmetaobject•Metaobject
Update Input! required Specifies parameters to update on the metaobject.
Arguments
- •ID!
- •mutation
Creates or updates a
Metaobjectbased on its handle. If a metaobject with the specified handle exists, the mutation updates it with the provided field values. If no matching metaobject exists, the mutation creates a new one.The handle serves as a unique identifier within a metaobject type. Field values map to the
's field keys and overwrite existing values during updates.- Anchor to handlehandle•Metaobject
Handle Input! required The identifier of the metaobject to upsert.
- Anchor to metaobjectmetaobject•Metaobject
Upsert Input! required The parameters to upsert the metaobject.
Arguments