I translate fields in Translate&Currency - LangShop
The main language of the store is German and translations are in English
Query to graphql api that returns translations of fields
{
products(first: 1) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
cursor
node {
title
description
featuredImage {
url
}
descriptionHtml
totalVariants
delivery_period_weeks: metafield(
namespace: "my_fields"
key: "delivery_period_weeks"
) {
key
value
}
tags
en: translations(locale: "en") {
key
locale
value
}
variants(first: 1) {
edges {
node {
price
}
}
}
}
}
}
}
The response from the server contains only the title and body_html
{
"data": {
"products": {
"pageInfo": {
"hasNextPage": true,
"hasPreviousPage": false
},
"edges": [
{
"cursor": "...",
"node": {
"title": "Produkt testen",
"description": "Test beschreibung",
"featuredImage": null,
"descriptionHtml": "Test beschreibung",
"totalVariants": 2,
"delivery_period_weeks": null,
"tags": [
"Raumteiler"
],
"en": [
{
"key": "body_html",
"locale": "en",
"value": "Test description
"
},
{
"key": "title",
"locale": "en",
"value": "Test product"
}
],
"variants": {
"edges": [
{
"node": {
"price": "1000.00"
}
}
]
}
}
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 9,
"actualQueryCost": 9,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 991,
"restoreRate": 50
}
}
}
}
The same applies to collections where you want to get a translation of a metafield
Is it possible to get translations of metafields and tags?
