Metafields are a flexible way for your app to add and store additional information about a Shopify resource. If you want to include data validation for metafield values, then you can create [metafield definitions](/docs/apps/build/custom-data/metafields/definitions).
This guide shows you how to manage metafields using the GraphQL Admin API.
## Requirements
- Your app can make [authenticated requests](/docs/api/admin-graphql#authentication) to the GraphQL Admin API.
- You've created [products](/docs/api/admin-graphql/latest/objects/Product) in your store.
## Step 1: Create a metafield
You can create any number of metafields for a resource, and they'll be accessible to any app. To create a metafield, use a GraphQL mutation to create or update the resource that you want the metafields to belong to.
The following example adds a metafield to a product by using the [`productUpdate`](/docs/api/admin-graphql/latest/mutations/productUpdate) mutation:
## Step 2: Retrieve a metafield
When you query a resource, you can retrieve its metafields. Use the `metafield` field to return a single metafield. Specify the metafield that you want to retrieve by using the `namespace` and `key` arguments.
The following example queries a product for the value of the associated `instructions.wash` metafield:
## Step 3: Update a metafield
To update a metafield, use a GraphQL mutation to update the owning resource, and include the metafield in the mutation input. Specify the owning resource and the metafields that you're updating by their IDs.
The following example updates a metafield that belongs to a product by using the [`productUpdate`](/docs/api/admin-graphql/latest/mutations/productUpdate) mutation:
## Step 4 (Optional): Delete a metafield
Use the [`metafieldDelete`](/docs/api/admin-graphql/unstable/mutations/metafieldDelete) mutation to delete a metafield. Specify the metafield that you want to delete by including its ID in the mutation input.
The following example deletes a metafield by ID:
## Next steps
- Create [metafield definitions](/docs/apps/build/custom-data/metafields/definitions) to include data validation for metafield values.
- Learn about [access controls](/docs/apps/build/custom-data/permissions) for app owned metafields.