translatableResourcesByIds
query
Requires read_translation access scope.
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Query translation data of a store using one or more resource IDs.
Arguments
Returns elements following the specified cursor. The
first argument must also be specified when using this argument.Returns elements preceding the specified cursor. The
last argument must also be specified when using this argument.Returns the first n elements in the list.
Returns the last n elements in the list.
Whether to reverse the order of the list.
● true: reverse
● false: do not reverse
Default value: false
List of unique identifiers for resources.
Return
edges
page info
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Query original and up-to-date translation data for a specific market and language within multiple resources.
Code
query MyQuery {
translatableResourcesByIds(
resourceIds: ["gid://shopline/Product/16065881455967920659531950", "gid://shopline/Product/16065881455967920659531951"]
first: 10,
reverse: false
) {
edges {
cursor
node {
resourceId
translatableContent {
digest
key
locale
type
value
}
translations(locale: "en", outdated: false, marketId: "2805979406510623080534") {
value
updatedAt
outdated
market {
id
}
locale
key
}
}
}
pageInfo {
startCursor
hasNextPage
endCursor
}
}
}
Response
{
"data": {
"translatableResourcesByIds": {
"edges": [
{
"cursor": "eyJyZXNvdXJjZUlkIjoiMTYwNjU4ODE0NTU5Njc5MjA2NTk1MzE5NTAifQ==",
"node": {
"resourceId": "gid://shopline/Product/16065881455967920659531950",
"translatableContent": [
{
"digest": "07ec01a6c4ea382ed6ae7671b7bcf358",
"key": "title",
"locale": "DEFAULT",
"type": "STRING",
"value": "Product title"
}
],
"translations": [
{
"outdated": false,
"value": "Default corpus English - Product title",
"key": "title",
"locale": "en",
"market": {
"id": "DEFAULT"
}
}
]
}
}
],
"pageInfo": {
"endCursor": "eyJyZXNvdXJjZUlkIjoiMTYwNjU4ODE0NTU5Njc5MjA2NTk1MzE5NTAifQ==",
"hasNextPage": "true",
"startCursor": "eyJyZXNvdXJjZUlkIjoiMTYwNjU4ODE0NTU5Njc5MjA2NTk1MzE5NTAifQ=="
}
}
}
}
Was this article helpful to you?