# MetafieldInput - admin-graphql - INPUT_OBJECT Version: 2024-07 ## Description The input fields to use to create or update a metafield through a mutation on the owning resource. An alternative way to create or update a metafield is by using the [metafieldsSet](https://shopify.dev/api/admin-graphql/latest/mutations/metafieldsSet) mutation. ### Access Scopes ## Fields * [description](/docs/api/admin-graphql/2024-07/scalars/String): String - The description of the metafield. * [id](/docs/api/admin-graphql/2024-07/scalars/ID): ID - The unique ID of the metafield. Using `owner_id`, `namespace`, and `key` is preferred for creating and updating. * [key](/docs/api/admin-graphql/2024-07/scalars/String): String - The unique identifier for a metafield within its namespace. Required when creating a metafield, but optional when updating. Used to help identify the metafield when updating, but can't be updated itself. Must be 2-64 characters long and can contain alphanumeric, hyphen, and underscore characters. * [namespace](/docs/api/admin-graphql/2024-07/scalars/String): String - The container for a group of metafields that the metafield is or will be associated with. Used in tandem with `key` to lookup a metafield on a resource, preventing conflicts with other metafields with the same `key`. Required when creating a metafield, but optional when updating. Used to help identify the metafield when updating, but can't be updated itself. Must be 3-255 characters long and can contain alphanumeric, hyphen, and underscore characters. * [type](/docs/api/admin-graphql/2024-07/scalars/String): String - The type of data that is stored in the metafield. Refer to the list of [supported types](https://shopify.dev/apps/metafields/types). Required when creating or updating a metafield without a definition. * [value](/docs/api/admin-graphql/2024-07/scalars/String): String - The data stored in the metafield. Always stored as a string, regardless of the metafield's type. ## Input objects with this input object * [CollectionInput](/docs/api/admin-graphql/2024-07/input-objects/CollectionInput) * [CustomerInput](/docs/api/admin-graphql/2024-07/input-objects/CustomerInput) * [DeliveryCustomizationInput](/docs/api/admin-graphql/2024-07/input-objects/DeliveryCustomizationInput) * [DiscountAutomaticAppInput](/docs/api/admin-graphql/2024-07/input-objects/DiscountAutomaticAppInput) * [DiscountCodeAppInput](/docs/api/admin-graphql/2024-07/input-objects/DiscountCodeAppInput) * [DraftOrderInput](/docs/api/admin-graphql/2024-07/input-objects/DraftOrderInput) * [LocationAddInput](/docs/api/admin-graphql/2024-07/input-objects/LocationAddInput) * [LocationEditInput](/docs/api/admin-graphql/2024-07/input-objects/LocationEditInput) * [fulfillmentConstraintRuleCreate](/docs/api/admin-graphql/2024-07/mutations/fulfillmentConstraintRuleCreate) * [OrderInput](/docs/api/admin-graphql/2024-07/input-objects/OrderInput) * [PaymentCustomizationInput](/docs/api/admin-graphql/2024-07/input-objects/PaymentCustomizationInput) * [ProductInput](/docs/api/admin-graphql/2024-07/input-objects/ProductInput) * [ProductSetInput](/docs/api/admin-graphql/2024-07/input-objects/ProductSetInput) * [ProductVariantInput](/docs/api/admin-graphql/2024-07/input-objects/ProductVariantInput) * [ProductVariantSetInput](/docs/api/admin-graphql/2024-07/input-objects/ProductVariantSetInput) * [ProductVariantsBulkInput](/docs/api/admin-graphql/2024-07/input-objects/ProductVariantsBulkInput) * [SellingPlanInput](/docs/api/admin-graphql/2024-07/input-objects/SellingPlanInput) * [ValidationCreateInput](/docs/api/admin-graphql/2024-07/input-objects/ValidationCreateInput) * [ValidationUpdateInput](/docs/api/admin-graphql/2024-07/input-objects/ValidationUpdateInput) ## Examples