You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a project that automatically translates everything on multi-sites. Our approach is using GraphQL to mutate the content on a different site. But our TableMakerField seems like only has table field in the graphql mutation code.
{
"data": {
"entries": [
{
"title": "Components Demonstration",
"contentBlocks": [
{
"table": {
"__typename": "table_TableMakerField",
"table": "\n <table>\n <thead>\n <tr>\n <th align=\"left\" width=\"\">Store</th><th align=\"left\" width=\"\">North America</th><th align=\"left\" width=\"\">Europe</th><th align=\"left\" width=\"\">International</th>\n </tr>\n </thead>\n\n <tbody><tr><td align=\"left\">Shipping to</td><td align=\"left\">Canada, USA</td><td align=\"left\">Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark…</td><td align=\"left\">Australia, Japan, New Zealand, Singapore, Brazil</td></tr><tr><td align=\"left\">Waranty</td><td align=\"left\">One-year warranty. Tulip covers shipping costs for warranty service. See Terms. </td><td align=\"left\">One-year warranty. Tulip does not cover shipping costs for warranty service. See Terms.</td><td align=\"left\">One-year warranty. Tulip does not cover shipping costs for warranty service. See Terms.</td></tr>\n\n </tbody>\n\n </table>\n ",
"columns": [
{
"heading": "Store",
"width": "",
"align": "left"
},
{
"heading": "North America",
"width": "",
"align": "left"
},
{
"heading": "Europe",
"width": "",
"align": "left"
},
{
"heading": "International",
"width": "",
"align": "left"
}
],
"rows": [
[
"Shipping to",
"Canada, USA",
"Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark…",
"Australia, Japan, New Zealand, Singapore, Brazil"
],
[
"Waranty",
"One-year warranty. Tulip covers shipping costs for warranty service. See Terms. ",
"One-year warranty. Tulip does not cover shipping costs for warranty service. See Terms.",
"One-year warranty. Tulip does not cover shipping costs for warranty service. See Terms."
]
]
}
}
]
}
]
}
}
So according to the response, what I expect is compose a GraphQL mutation query to change the columns and rows on sites in other languages. However the only field I could use in the mutation is table. So I tried use the table html in the above response.
Here is the GraphQL mutation I tried:
mutation {
save_pages_pages_Entry(
id: "216123"contentBlocks: {
sortOrder: [
"230833"
]
blocks: [
{
tableBlock: {
id: "230833"
table: "\n <table>\n <thead>\n <tr>\n <th align=\"left\" width=\"\">Store</th><th align=\"left\" width=\"\">North America</th><th align=\"left\" width=\"\">Europe</th><th align=\"left\" width=\"\">International</th>\n </tr>\n </thead>\n\n <tbody><tr><td align=\"left\">Shipping to</td><td align=\"left\">Canada, USA</td><td align=\"left\">Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark…</td><td align=\"left\">Australia, Japan, New Zealand, Singapore, Brazil</td></tr><tr><td align=\"left\">Waranty</td><td align=\"left\">One-year warranty. Tulip covers shipping costs for warranty service. See Terms. </td><td align=\"left\">One-year warranty. Tulip does not cover shipping costs for warranty service. See Terms.</td><td align=\"left\">One-year warranty. Tulip does not cover shipping costs for warranty service. See Terms.</td></tr>\n\n </tbody>\n\n </table>\n "
}
}
]
}
siteId: 7
) {
id
}
}
Question
I'm working on a project that automatically translates everything on multi-sites. Our approach is using GraphQL to mutate the content on a different site. But our TableMakerField seems like only has
table
field in the graphql mutation code.Here is the code I tried:
Query:
Response:
So according to the response, what I expect is compose a GraphQL mutation query to change the
columns
androws
on sites in other languages. However the only field I could use in the mutation istable
. So I tried use the table html in the above response.Here is the GraphQL mutation I tried:
Got the error:
We got a json decode error. Am I supposed to pass a json string? What is the correct way to do it?
Additional context
No response
The text was updated successfully, but these errors were encountered: