--- title: MetafieldRelation - GraphQL Admin description: |- Defines a relation between two resources via a reference metafield. The referencer owns the joining field with a given namespace and key, while the target is referenced by the field. api_version: 2025-01 api_name: admin type: object api_type: graphql source_url: html: 'https://shopify.dev/docs/api/admin-graphql/2025-01/objects/MetafieldRelation' md: >- https://shopify.dev/docs/api/admin-graphql/2025-01/objects/MetafieldRelation.md --- # Metafield​Relation object Defines a relation between two resources via a reference metafield. The referencer owns the joining field with a given namespace and key, while the target is referenced by the field. ## Fields * key [String!](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/String) non-null The key of the field making the reference. * name [String!](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/String) non-null The name of the field making the reference. * namespace [String!](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/String) non-null The namespace of the metafield making the reference, or type of the metaobject. * referencer [Metafield​Referencer!](https://shopify.dev/docs/api/admin-graphql/2025-01/unions/MetafieldReferencer) non-null The resource making the reference. * target [Metafield​Reference!](https://shopify.dev/docs/api/admin-graphql/2025-01/unions/MetafieldReference) non-nullDeprecated *** ## Map ### Fields and connections with this object * <->[MetafieldRelationConnection.nodes](https://shopify.dev/docs/api/admin-graphql/2025-01/connections/MetafieldRelationConnection#returns-nodes) * {}[MetafieldRelationEdge.node](https://shopify.dev/docs/api/admin-graphql/2025-01/objects/MetafieldRelationEdge#field-MetafieldRelationEdge.fields.node) * {}[Metaobject.referencedBy](https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metaobject#field-Metaobject.fields.referencedBy)