Hi all,
I’ve created a custom ui extension (APP SDK) to handle Key-Value pairs.
Like this.
Key: “item one”
Value: reference to a entry.
saving this will create a json object like
{
{
"section_one_intro":{
"sys":{
"id":"11p8YlxXxBngHjZcJ9EbDX",
"type":"Entry",
"space":{
"sys":{
"id":"ne8byh03zy6e",
"type":"Link",
"linkType":"Space"
}
},
"version":7,
"createdAt":"2022-04-14T11:59:12.507Z",
"createdBy":{
"sys":{
"id":"3rSm4OtlLpwUvPA9Yeqq6y",
"type":"Link",
"linkType":"User"
}
},
"updatedAt":"2022-04-20T12:00:56.609Z",
"updatedBy":{
"sys":{
"id":"3rSm4OtlLpwUvPA9Yeqq6y",
"type":"Link",
"linkType":"User"
}
},
"contentType":{
"sys":{
"id":"textBlock",
"type":"Link",
"linkType":"ContentType"
}
},
"environment":{
"sys":{
"id":"poc",
"type":"Link",
"linkType":"Environment"
}
},
"publishedAt":"2022-04-20T12:00:56.609Z",
"publishedBy":{
"sys":{
"id":"3rSm4OtlLpwUvPA9Yeqq6y",
"type":"Link",
"linkType":"User"
}
},
"firstPublishedAt":"2022-04-14T11:59:30.822Z",
"publishedCounter":2,
"publishedVersion":6
},
"fields":{
"name":{
"en":"..."
},
"rtCopy":{
"en":{
"data":{
},
"content":[
{
"data":{
},
"content":[
{
"data":{
},
"marks":[
],
"value":"...",
"nodeType":"text"
}
],
"nodeType":"paragraph"
}
],
"nodeType":"document"
}
},
"alignment":{
"en":"Left"
}
},
"metadata":{
"tags":[
]
}
}
}```
or this for an image
```{
"section_one_phone_shadow":{
"sys":{
"id":"3HvLchPrwS1cOBhdRkhlqx",
"type":"Entry",
"space":{
"sys":{
"id":"ne8byh03zy6e",
"type":"Link",
"linkType":"Space"
}
},
"version":4,
"createdAt":"2022-04-14T12:08:51.513Z",
"createdBy":{
"sys":{
"id":"3rSm4OtlLpwUvPA9Yeqq6y",
"type":"Link",
"linkType":"User"
}
},
"updatedAt":"2022-04-14T12:10:10.985Z",
"updatedBy":{
"sys":{
"id":"3rSm4OtlLpwUvPA9Yeqq6y",
"type":"Link",
"linkType":"User"
}
},
"contentType":{
"sys":{
"id":"imageBlock",
"type":"Link",
"linkType":"ContentType"
}
},
"environment":{
"sys":{
"id":"poc",
"type":"Link",
"linkType":"Environment"
}
},
"publishedAt":"2022-04-14T12:10:10.985Z",
"publishedBy":{
"sys":{
"id":"3rSm4OtlLpwUvPA9Yeqq6y",
"type":"Link",
"linkType":"User"
}
},
"firstPublishedAt":"2022-04-14T12:10:10.985Z",
"publishedCounter":1,
"publishedVersion":3
},
"fields":{
"size":{
"en":"large"
},
"image":{
"en":{
"sys":{
"id":"bbNYqqlJUuf5rU5fN6ysA",
"type":"Link",
"linkType":"Asset"
}
}
},
"alternativeText":{
"en":"...
}
},
"metadata":{
"tags":[
]
}
}
}```
We need this data in a React Gatsby project.
So using the Gatsby-source-contentful plugin we need for these references to get resolved to an actual image.
How can I make sure that this value for the image gets resolved correctly when running my queries?
all the help is much appreciated!