Example JSON feature
This example demonstrates a JSON transformation targeting objects with specific field values, such as __typename
set to Article
.
In this example, we perform a transformation on JSON content, and target the object that contains a field called
__typename
with a value of
Article
.
Example JSON Content
For this example, we use the following JSON content:
{
"data": {
"getContentByUrl": {
"page": {
"__typename": "Article",
"title": "This Is A Test Article",
"body": [
{
"__typename": "DataBlock",
"type": "TEXT",
"data": "\"<p><span><span><span><span><span><span>Here is the first paragraph of content.</span></span></span></span></span></span></p>\\n\""
},
{
"__typename": "DataBlock",
"type": "TEXT",
"data": "\"<p><span><span><span><span><span><span>Here is paragraph number two.</span></span></span></span></span></span></p>\\n\""
},
{
"__typename": "DataBlock",
"type": "TEXT",
"data": "\"<p><a href=\\\"https://www.example.com/test/test-data/22021/test-data-link\\\"><strong>> Click here to review our sample data.</strong></a></p>\\n\""
},
{
"__typename": "DataBlock",
"type": "TEXT",
"data": "\"<p><span><span><span><span><span><span>A third paragraph appears!</span></span></span></span></span></span></p>\\n\""
},
{
"__typename": "DataBlock",
"type": "TEXT",
"data": "\"<p><span><span><span><span><span><span>This is the end of the article.</span></span></span></span></span></span><span><span><span><strong><span><span>evo</span></span></strong></span></span></span><span><span><span><span><span><span> readers is another matter, and with a large choice of circa-300bhp alternatives in the hot hatch class, the M135i xDrive will have to be special indeed to warrant attention</span></span></span></span></span></span></p>\\n\""
}
]
}
}
}
}