--- title: MetafieldReference - Customer API description: Returns the resource which is being referred to by a metafield. api_version: 2026-01 api_name: customer type: union api_type: graphql source_url: html: 'https://shopify.dev/docs/api/customer/latest/unions/MetafieldReference' md: 'https://shopify.dev/docs/api/customer/latest/unions/MetafieldReference.md' --- # Metafield​Reference union Returns the resource which is being referred to by a metafield. ## Possible types * [Generic​File](https://shopify.dev/docs/api/customer/latest/objects/GenericFile) OBJECT The generic file resource lets you manage files in a merchant's store. Generic files include any file that doesn't fit into a designated type such as image or video. Example: PDF, JSON. * alt [String](https://shopify.dev/docs/api/customer/latest/scalars/String) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) A word or phrase to indicate the contents of a file. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) A globally-unique ID. * media​Content​Type [Media​Content​Type!](https://shopify.dev/docs/api/customer/latest/enums/MediaContentType) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The media content type. * mime​Type [String](https://shopify.dev/docs/api/customer/latest/scalars/String) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The MIME type of the file. * original​File​Size [Int](https://shopify.dev/docs/api/customer/latest/scalars/Int) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The size of the original file in bytes. * preview​Image [Image](https://shopify.dev/docs/api/customer/latest/objects/Image) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The preview image for the media. * url [URL](https://shopify.dev/docs/api/customer/latest/scalars/URL) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The URL of the file. * [Media​Image](https://shopify.dev/docs/api/customer/latest/objects/MediaImage) OBJECT Represents a Shopify hosted image. * alt [String](https://shopify.dev/docs/api/customer/latest/scalars/String) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) A word or phrase to share the nature or contents of a media. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) A globally-unique ID. * image [Image](https://shopify.dev/docs/api/customer/latest/objects/Image) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The image for the media. * media​Content​Type [Media​Content​Type!](https://shopify.dev/docs/api/customer/latest/enums/MediaContentType) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The media content type. * preview​Image [Image](https://shopify.dev/docs/api/customer/latest/objects/Image) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The preview image for the media. * [Metaobject](https://shopify.dev/docs/api/customer/latest/objects/Metaobject) OBJECT An instance of a user-defined model based on a MetaobjectDefinition. * field [Metaobject​Field](https://shopify.dev/docs/api/customer/latest/objects/MetaobjectField) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) Accesses a field of the object by key. * key [String!](https://shopify.dev/docs/api/customer/latest/scalars/String) required ### Arguments The key of the field. *** * fields [\[Metaobject​Field!\]!](https://shopify.dev/docs/api/customer/latest/objects/MetaobjectField) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) All object fields with defined values. Omitted object keys can be assumed null, and no guarantees are made about field order. * handle [String!](https://shopify.dev/docs/api/customer/latest/scalars/String) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The unique handle of the metaobject. Useful as a custom ID. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) A globally-unique ID. * type [String!](https://shopify.dev/docs/api/customer/latest/scalars/String) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The type of the metaobject. * updated​At [Date​Time!](https://shopify.dev/docs/api/customer/latest/scalars/DateTime) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The date and time when the metaobject was last updated. * [Model3d](https://shopify.dev/docs/api/customer/latest/objects/Model3d) OBJECT Represents a Shopify hosted 3D model. * alt [String](https://shopify.dev/docs/api/customer/latest/scalars/String) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) A word or phrase to share the nature or contents of a media. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) A globally-unique ID. * media​Content​Type [Media​Content​Type!](https://shopify.dev/docs/api/customer/latest/enums/MediaContentType) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The media content type. * preview​Image [Image](https://shopify.dev/docs/api/customer/latest/objects/Image) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The preview image for the media. * sources [\[Model3d​Source!\]!](https://shopify.dev/docs/api/customer/latest/objects/Model3dSource) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The sources for a 3d model. * [Video](https://shopify.dev/docs/api/customer/latest/objects/Video) OBJECT Represents a Shopify hosted video. * alt [String](https://shopify.dev/docs/api/customer/latest/scalars/String) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) A word or phrase to share the nature or contents of a media. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) A globally-unique ID. * media​Content​Type [Media​Content​Type!](https://shopify.dev/docs/api/customer/latest/enums/MediaContentType) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The media content type. * preview​Image [Image](https://shopify.dev/docs/api/customer/latest/objects/Image) [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The preview image for the media. * sources [\[Video​Source!\]!](https://shopify.dev/docs/api/customer/latest/objects/VideoSource) non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api) The sources for a video. *** ## Fields with this union * [Metafield.reference](https://shopify.dev/docs/api/customer/latest/objects/Metafield#field-Metafield.fields.reference) OBJECT The custom metadata attached to a resource. Metafields can be sorted into namespaces and are comprised of keys, values, and value types. * [Metafield.references](https://shopify.dev/docs/api/customer/latest/objects/Metafield#field-Metafield.fields.references) OBJECT The custom metadata attached to a resource. Metafields can be sorted into namespaces and are comprised of keys, values, and value types. * [Metafield​Reference​Connection.nodes](https://shopify.dev/docs/api/customer/latest/connections/MetafieldReferenceConnection#returns-nodes) CONNECTION An auto-generated type for paginating through multiple MetafieldReferences. * [Metafield​Reference​Edge.node](https://shopify.dev/docs/api/customer/latest/objects/MetafieldReferenceEdge#field-MetafieldReferenceEdge.fields.node) OBJECT An auto-generated type which holds one MetafieldReference and a cursor during pagination. * [Metaobject​Field.reference](https://shopify.dev/docs/api/customer/latest/objects/MetaobjectField#field-MetaobjectField.fields.reference) OBJECT Provides the value of a Metaobject field. *** ```graphql union MetafieldReference = GenericFile | MediaImage | Metaobject | Model3d | Video ```