--- title: MetafieldDefinitionConstraints - GraphQL Admin description: >- The [constraints](https://shopify.dev/apps/build/custom-data/metafields/conditional-metafield-definitions) that determine what subtypes of resources a metafield definition applies to. 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/MetafieldDefinitionConstraints md: >- https://shopify.dev/docs/api/admin-graphql/2025-01/objects/MetafieldDefinitionConstraints.md --- # Metafield​Definition​Constraints object The [constraints](https://shopify.dev/apps/build/custom-data/metafields/conditional-metafield-definitions) that determine what subtypes of resources a metafield definition applies to. ## Fields * key [String](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/String) The category of resource subtypes that the definition applies to. * values [Metafield​Definition​Constraint​Value​Connection!](https://shopify.dev/docs/api/admin-graphql/2025-01/connections/MetafieldDefinitionConstraintValueConnection) non-null The specific constraint subtype values that the definition applies to. * first [Int](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/Int) ### Arguments The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * after [String](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/String) The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * last [Int](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/Int) The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * before [String](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/String) The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * reverse [Boolean](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/Boolean) Default:false Reverse the order of the underlying list. *** *** ## Map ### Fields with this object * {}[MetafieldDefinition.constraints](https://shopify.dev/docs/api/admin-graphql/2025-01/objects/MetafieldDefinition#field-MetafieldDefinition.fields.constraints)