Hey there!
Contentful's linking mechanism operates in a unique way, as seen in the JSON response from the collection endpoint which consists of two main segments – "items" and "includes".
{
"items": [
{
"sys": {
"type": "Entry",
"id": "4rJn9OJsBiAKmeoiiw40Ko",
},
"fields": {
"name": "Menu for Humans",
"stickiness": 999.3,
"menuMeal": [
{
"sys": {
"type": "Link",
"linkType": "Entry",
"id": "3HkMtbj6hqcMYEqWIOm6SQ"
}
}
]
}
},
],
"includes": {
"Entry": [
{
"sys": {
"id": "3HkMtbj6hqcMYEqWIOm6SQ",
"type": "Entry",
...
},
"fields": {...}
},
...
}
]
}
The items in "items" make reference to other elements within the "includes" section. The SDKs handle this complexity by resolving these references automatically, allowing you to access fields recursively within the response structure.
It is essential to include the "sys" property in the JS SDK, as highlighted here, as it plays a crucial role in link resolution.