Version: 2024-10
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" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<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}"
input: null
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" } } } ] } } }