# standardMetafieldDefinitionTemplates - admin-graphql - QUERY Version: 2024-10 ## Description Standard metafield definitions are intended for specific, common use cases. Their namespace and keys reflect these use cases and are reserved. Refer to all available [`Standard Metafield Definition Templates`](https://shopify.dev/api/admin-graphql/latest/objects/StandardMetafieldDefinitionTemplate). ### Access Scopes ## Arguments * [after](/docs/api/admin-graphql/2024-10/scalars/String): String - The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * [before](/docs/api/admin-graphql/2024-10/scalars/String): String - The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * [constraintStatus](/docs/api/admin-graphql/2024-10/enums/MetafieldDefinitionConstraintStatus): MetafieldDefinitionConstraintStatus - Filter standard metafield definitions based on whether they are constrained. * [constraintSubtype](/docs/api/admin-graphql/2024-10/input-objects/MetafieldDefinitionConstraintSubtypeIdentifier): MetafieldDefinitionConstraintSubtypeIdentifier - Filter standard metafield definitions based on whether they apply to a given resource subtype. * [excludeActivated](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean - Filter standard metafield definitions that have already been activated. * [first](/docs/api/admin-graphql/2024-10/scalars/Int): Int - The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * [last](/docs/api/admin-graphql/2024-10/scalars/Int): Int - The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * [reverse](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean - Reverse the order of the underlying list. ## Returns * [edges](/docs/api/admin-graphql/2024-10/objects/StandardMetafieldDefinitionTemplateEdge): StandardMetafieldDefinitionTemplateEdge! The connection between the node and its parent. Each edge contains a minimum of the edge's cursor and the node. * [nodes](/docs/api/admin-graphql/2024-10/objects/StandardMetafieldDefinitionTemplate): StandardMetafieldDefinitionTemplate! A list of nodes that are contained in StandardMetafieldDefinitionTemplateEdge. You can fetch data about an individual node, or you can follow the edges to fetch data about a collection of related nodes. At each node, you specify the fields that you want to retrieve. * [pageInfo](/docs/api/admin-graphql/2024-10/objects/PageInfo): PageInfo! An object that’s used to retrieve [cursor information](https://shopify.dev/api/usage/pagination-graphql) about the current page. ## Examples ### Get a list of standard metafield definition templates Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query StandardMetafieldDefinitionTemplates { standardMetafieldDefinitionTemplates(first: 5) { edges { node { id name namespace key description ownerTypes type { name } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query StandardMetafieldDefinitionTemplates {\n standardMetafieldDefinitionTemplates(first: 5) {\n edges {\n node {\n id\n name\n namespace\n key\n description\n ownerTypes\n type {\n name\n }\n }\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query StandardMetafieldDefinitionTemplates {\n standardMetafieldDefinitionTemplates(first: 5) {\n edges {\n node {\n id\n name\n namespace\n key\n description\n ownerTypes\n type {\n name\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query StandardMetafieldDefinitionTemplates {\n standardMetafieldDefinitionTemplates(first: 5) {\n edges {\n node {\n id\n name\n namespace\n key\n description\n ownerTypes\n type {\n name\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query StandardMetafieldDefinitionTemplates {\n standardMetafieldDefinitionTemplates(first: 5) {\n edges {\n node {\n id\n name\n namespace\n key\n description\n ownerTypes\n type {\n name\n }\n }\n }\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "standardMetafieldDefinitionTemplates": { "edges": [ { "node": { "id": "gid://shopify/StandardMetafieldDefinitionTemplate/1", "name": "Product subtitle", "namespace": "descriptors", "key": "subtitle", "description": "Used as a shorthand for a product name", "ownerTypes": [ "PRODUCT", "PRODUCTVARIANT" ], "type": { "name": "single_line_text_field" } } }, { "node": { "id": "gid://shopify/StandardMetafieldDefinitionTemplate/2", "name": "Care guide", "namespace": "descriptors", "key": "care_guide", "description": "Instructions for taking care of a product or apparel", "ownerTypes": [ "PRODUCT", "PRODUCTVARIANT" ], "type": { "name": "multi_line_text_field" } } }, { "node": { "id": "gid://shopify/StandardMetafieldDefinitionTemplate/3", "name": "ISBN", "namespace": "facts", "key": "isbn", "description": "International Standard Book Number", "ownerTypes": [ "PRODUCT", "PRODUCTVARIANT" ], "type": { "name": "single_line_text_field" } } }, { "node": { "id": "gid://shopify/StandardMetafieldDefinitionTemplate/4", "name": "UPC", "namespace": "facts", "key": "upc", "description": "Universal Product Code", "ownerTypes": [ "PRODUCT", "PRODUCTVARIANT" ], "type": { "name": "single_line_text_field" } } }, { "node": { "id": "gid://shopify/StandardMetafieldDefinitionTemplate/5", "name": "EAN", "namespace": "facts", "key": "ean", "description": "European Article Number", "ownerTypes": [ "PRODUCT", "PRODUCTVARIANT" ], "type": { "name": "single_line_text_field" } } } ] } } }