I’m a little stuck on getting an entries content in graphql. This is part of a result being returned from a UI extension. bar is a link to another piece of Contentful content with a title and a rich text field. However, it does not return any of the content of that entry.
Do I need to change the way that the UI Extension is linking/referencing the entry or do I need to change the graphql to get this data?
Can you give some more details/context about your setup? I think I understand what you are trying to do, but I don’t understand enough about this UI extension you mention and the field it is sitting on to answer your question.
in what type of field is this data?
what does the UI extension do?
is the UI extension making GraphQL calls or is the rendering application making GraphQL calls?
The extension is used to create a flow chart /decision tree with interconnected nodes containing multiple choice questions that eventually lead to a result node. In each question node or result I am adding some extra text which is another Contentful entry (content type of simpleRichTextBlock).
The extension itself does not make any graphql calls and generates JSON which is saved in the field it is assigned to.
I’m then querying this field in Gatsby and hoping to get something back like the below for that entry that I have chosen:
So the JSON generated by the extension is saved in a JSON object field type, right? If that’s the case then that is why your GraphQL API request isn’t resolving the referenced entry. JSON objects are just oblique blobs of JSON to our API, we don’t interpret them in any way. To resolve referenced entries, make the underlying field type a Reference (either single or multiple). Or you’d have to make a second API call to resolve the entry as stored in your JSON blob by the UI extension.