Metaobject Definition
Requires access scope.
Defines the structure and configuration for a custom data type in Shopify. Each definition specifies the fields, validation rules, and capabilities that apply to all Metaobject entries created from it.
The definition includes field definitions that determine what data to store, access controls for the Shopify admin and Storefront APIs, and capabilities such as publishability and translatability. You can track which App or created the definition and optionally base it on a .
Anchor to FieldsFields
- Anchor to accessaccess•Metaobject
Access! non-null Access configuration for the metaobject definition.
- Anchor to capabilitiescapabilities•Metaobject
Capabilities! non-null The capabilities of the metaobject definition.
- Anchor to createdAtcreated•Date
At Time! non-null The date and time when the metaobject definition was created.
- Anchor to createdByAppcreated•App!
By App non-null The app used to create the metaobject definition.
- Anchor to createdByStaffcreated•Staff
By Staff Member The staff member who created the metaobject definition.
- Anchor to descriptiondescription•String
The administrative description.
- Anchor to displayNameKeydisplay•String
Name Key The key of a field to reference as the display name for each object.
- Anchor to fieldDefinitionsfield•[Metaobject
Definitions Field Definition!]! non-null The fields defined for this object type.
- Anchor to hasThumbnailFieldhas•Boolean!
Thumbnail Field non-null Whether this metaobject definition has field whose type can visually represent a metaobject with the
.- •ID!non-null
A globally-unique ID.
- Anchor to metaobjectsmetaobjects•Metaobject
Connection! non-null A paginated connection to the metaobjects associated with the definition.
- 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 metaobjectsCountmetaobjects•Int!
Count non-null The count of metaobjects created for the definition.
- Anchor to namename•String!non-null
The human-readable name.
- Anchor to standardTemplatestandard•Standard
Template Metaobject Definition Template The standard metaobject template associated with the definition.
- Anchor to typetype•String!non-null
The type of the object definition. Defines the namespace of associated metafields.
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time when the metaobject definition was last updated.
Anchor to QueriesQueries
- •query
Retrieves a
by its global ID. Metaobject definitions provide the structure and fields for metaobjects.The definition includes field configurations, access settings, display preferences, and capabilities that determine how metaobjects of this type behave across the Shopify platform.
- •ID!required
The ID of the metaobject to return.
Arguments
- •ID!
- •query
Retrieves a
by its type. The type serves as a unique identifier that distinguishes one metaobject definition from another.- Anchor to typetype•String!required
The type of the metaobject definition to return.
Arguments
- •query
Returns a paginated list of all
objects configured for the store. Metaobject definitions provide the schema for creating custom data structures composed of individual fields. Each definition specifies the field types, access permissions, and capabilities forMetaobjectentries of that type. Use this query to discover available metaobject types before creating or querying metaobject entries.Learn more about managing metaobjects.
- 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 MutationsMutations
- •mutation
Creates a metaobject definition that establishes the structure for custom data objects in your store. The definition specifies the fields, data types, and access permissions that all
Metaobjectentries of this type share.Use the
typefield to create a unique namespace for your metaobjects. Prefix the type with$app:to reserve the definition for your app's exclusive use. The definition can include capabilities like publishable status or translation eligibility, to extend how metaobjects integrate with Shopify's features.Learn more about managing metaobjects.
- Anchor to definitiondefinition•Metaobject
Definition Create Input! required The input fields for creating a metaobject definition.
Arguments
- •mutation
Updates a
's configuration and field structure. You can modify the definition's name, description, display name key, access controls, and capabilities, as well as those of all its fields.The mutation supports reordering fields when
istrue, which arranges submitted fields first followed by alphabetized omitted fields.Learn more about managing metaobjects.
- •ID!required
The ID of the metaobject definition to update.
- Anchor to definitiondefinition•Metaobject
Definition Update Input! required The input fields for updating a metaobject definition.
Arguments
- •ID!
- •mutation
Enables the specified standard metaobject definition from its template.
- Anchor to typetype•String!required
The type of the metaobject definition to enable.
Arguments