Version: 2024-01
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { translatableResourcesByIds(first: 10, resourceIds: [\\\"gid://shopify/Product/20995642\\\"]) { 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 translatableResourcesByIds(first: 10, resourceIds: [\"gid://shopify/Product/20995642\"]) {\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 translatableResourcesByIds(first: 10, resourceIds: [\"gid://shopify/Product/20995642\"]) {\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 translatableResourcesByIds(first: 10, resourceIds: [\"gid://shopify/Product/20995642\"]) {\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 translatableResourcesByIds(first: 10, resourceIds: [\"gid://shopify/Product/20995642\"]) {\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 translatableResourcesByIds(first: 10, resourceIds: [\"gid://shopify/Product/20995642\"]) {\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": { "translatableResourcesByIds": { "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" } ] } } ] } } }