Version: 2024-07
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { translatableResources(first: 5, resourceType: PRODUCT) { edges { node { resourceId translatableContent { key value digest locale } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n translatableResources(first: 5, resourceType: PRODUCT) {\n edges {\n node {\n resourceId\n translatableContent {\n key\n value\n digest\n locale\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 {\n translatableResources(first: 5, resourceType: PRODUCT) {\n edges {\n node {\n resourceId\n translatableContent {\n key\n value\n digest\n locale\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\n query {\n translatableResources(first: 5, resourceType: PRODUCT) {\n edges {\n node {\n resourceId\n translatableContent {\n key\n value\n digest\n locale\n }\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n translatableResources(first: 5, resourceType: PRODUCT) {\n edges {\n node {\n resourceId\n translatableContent {\n key\n value\n digest\n locale\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n translatableResources(first: 5, resourceType: PRODUCT) {\n edges {\n node {\n resourceId\n translatableContent {\n key\n value\n digest\n locale\n }\n }\n }\n }\n}"
input: null
response: { "data": { "translatableResources": { "edges": [ { "node": { "resourceId": "gid://shopify/Product/20995642", "translatableContent": [ { "key": "title", "value": "Element", "digest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6", "locale": "en" }, { "key": "body_html", "value": "<p>bad board</p>", "digest": "60cd8aaeeec8e14d9da0dd1ed4cff31c0bb8f9c64255adad9dc1d2140c472f3b", "locale": "en" }, { "key": "handle", "value": "element", "digest": "445929267209c034d1e324834c17e0c8305df3dcb21d1710a639ac6ca08c648b", "locale": "en" }, { "key": "product_type", "value": "Snowboards", "digest": "3c752b33c3546064f02d47978a3883019e5bef320ddbc48875318b8d76c6154b", "locale": "en" } ] } }, { "node": { "resourceId": "gid://shopify/Product/108828309", "translatableContent": [ { "key": "title", "value": "Draft", "digest": "ebf12ef47cf575b3ba9a3cc019c5310146fdac88f6d1be6618d6e91158c2f174", "locale": "en" }, { "key": "body_html", "value": "<p>good board</p>", "digest": "6e634d476ca1dde2a0992fd6f57fc48b5979c8a4ee19117044a054f9f601ae56", "locale": "en" }, { "key": "handle", "value": "draft", "digest": "7743ce348d9284d677a185f33295b92266cc435a5b5f775029b300066d26693a", "locale": "en" }, { "key": "product_type", "value": "Snowboards", "digest": "3c752b33c3546064f02d47978a3883019e5bef320ddbc48875318b8d76c6154b", "locale": "en" } ] } }, { "node": { "resourceId": "gid://shopify/Product/121709582", "translatableContent": [ { "key": "title", "value": "Boots", "digest": "929433e4be1dbd23ffc6b076da2e6f3854ccc5fe606a1e59419110b71fe0a833", "locale": "en" }, { "key": "body_html", "value": "<p>some boots</p>", "digest": "8e6907bdb64ea435ccc2874160eaa35db63c95bb5804d93ea460c3a72a68c00c", "locale": "en" }, { "key": "handle", "value": "boots", "digest": "40cafc18e93464f86d5d304e726df74311237955bcf7d99909bcef3f0bcb90bb", "locale": "en" }, { "key": "product_type", "value": "Boots", "digest": "929433e4be1dbd23ffc6b076da2e6f3854ccc5fe606a1e59419110b71fe0a833", "locale": "en" } ] } }, { "node": { "resourceId": "gid://shopify/Product/440089423", "translatableContent": [ { "key": "title", "value": "IPod Nano - 8GB", "digest": "4ce3c71c164cd0ddc7c95e7d554d9b028e6a6ed4abff8a71ad714c6f2f1a7e4a", "locale": "en" }, { "key": "body_html", "value": "<p>It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.</p>", "digest": "d3378109cc15e6d88148c52661e687203c692141fe837dbe983fd02e9b095803", "locale": "en" }, { "key": "handle", "value": "ipod-nano", "digest": "226259c06fdbf95cd3b681de6db73d0346c7dae4d381f0472c0e405b73cf57e0", "locale": "en" }, { "key": "product_type", "value": "Cult Products", "digest": "be736be3f50f1755fdc2f5bc96b10251d56cd1888a51889321cb96d605078c42", "locale": "en" } ] } }, { "node": { "resourceId": "gid://shopify/Product/558169081", "translatableContent": [ { "key": "title", "value": "Unpublished Boots", "digest": "1654ceb776b32b1bf3298e88ce86829478d3be20669887faebc98daf88ebabc0", "locale": "en" }, { "key": "body_html", "value": "<p>some boots</p>", "digest": "8e6907bdb64ea435ccc2874160eaa35db63c95bb5804d93ea460c3a72a68c00c", "locale": "en" }, { "key": "handle", "value": "unpublished_boots", "digest": "8fa116cf72ed66775134127295e199c727b3756c676b13699b2060db2f19d78c", "locale": "en" }, { "key": "product_type", "value": "Boots", "digest": "929433e4be1dbd23ffc6b076da2e6f3854ccc5fe606a1e59419110b71fe0a833", "locale": "en" } ] } } ] } } }