{
"MyAsset": {
"Code": "Cod123",
"MyAssetLocation": [{
"Location": {
"LocationName": "Location 1"
}
},{
"Location": {
"LocationName": "Location 2"
}
}
]
}
}
I wanted to write a graphql query against the entity MyAsset in such a way that it should return the data like below.
First record
{code:"Cod123",MyAssetLocation.Location:"Location 1"}
Second Record
{code:"Cod123",MyAssetLocation.Location:"Location 2"}
Basically I wanted to flatten the result by duplicating MyAsset details with MyAssetLocation.Location Items.
I have a data structure like below
{ "MyAsset": { "Code": "Cod123", "MyAssetLocation": [{ "Location": { "LocationName": "Location 1" } },{ "Location": { "LocationName": "Location 2" } } ] } } I wanted to write a graphql query against the entity MyAsset in such a way that it should return the data like below.
First record
{code:"Cod123",MyAssetLocation.Location:"Location 1"} Second Record
{code:"Cod123",MyAssetLocation.Location:"Location 2"} Basically I wanted to flatten the result by duplicating MyAsset details with MyAssetLocation.Location Items.