A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hello all,
I'm trying to figure out how to use the Before/After arguments in TranslatableResources GraphQL mentioned on this page.
Root-Problem Details:
We sell second-hand clothes in Europe. This means the following:
- Each product is unique and exists only once
- We sell for different countries speaking different languages.
Based on this information, using an automatic translation app to translate our products will costs us a lot of money and won't stop charging us.
My approach:
We decided to do it with a shopify private app that will
1- retrieve the newly added TranslatableResources
2- translate using a private service
3- send a mutation call to update the translation.
Summary:
in order for this approach to work, I need to retrieve not only the last 99 items but more and I think my solution lies with using before/after cursors but there is nowhere on the internet where it shows how to use it 😕
the current query I'm using:
{
translatableResources(last: 99, resourceType: PRODUCT) {
edges {
node {
resourceId
translatableContent {
key
value
digest
locale
}
}
}
}
}
Solved! Go to the solution
This is an accepted solution.
Hi again,
I found the answer to my problem in a german article by Shopify so I thought it will be useful to share here.
The idea is that you should retrieve the cursor so you can use it.
like this
{
translatableResources(first: 20, resourceType: METAFIELD) {
edges {
cursor
node {
resourceId
translatableContent {
key
value
digest
locale
}
}
}
}
}
This is an accepted solution.
Hi again,
I found the answer to my problem in a german article by Shopify so I thought it will be useful to share here.
The idea is that you should retrieve the cursor so you can use it.
like this
{
translatableResources(first: 20, resourceType: METAFIELD) {
edges {
cursor
node {
resourceId
translatableContent {
key
value
digest
locale
}
}
}
}
}