Prompt
Why is my headless CMS API returning empty fields for linked entries?
Latest observation
Oct 21, 2026
OpenAI APIWeb search: off
This usually happens because the API is returning links/reference stubs, not the full linked entry data.
Common causes:
-
You didn’t request link expansion / population
- Many headless CMSs return linked entries as IDs or minimal link objects unless you explicitly “expand,” “include,” or “populate” them.
- Examples:
- Contentful: use
include=1..N - Strapi: use
populate=*or specific populate paths - Sanity: use GROQ projections to dereference
- DatoCMS: query nested fields explicitly
- Contentful: use
-
The linked entry is unpublished or not accessible
- If the linked item isn’t published, or your token/role can’t read it, the API may omit it or return partial/empty data.
-
The fields in the linked entry are empty or restricted
- The entry may exist, but the linked fields you expect are blank, localized differently, or hidden by permissions.
-
You’re hitting a depth limit
- Some CMSs only resolve links up to a certain nesting level. Deeper linked entries may come back as empty references.
-
Wrong query shape
- If you’re using GraphQL or a projection-based API, you must explicitly select the fields inside the linked object. Otherwise you’ll only get the reference metadata.
-
Localization / draft mode mismatch
- You may be requesting a locale where the linked entry has no content, or querying draft content without the correct preview endpoint/token.
What to check
- Inspect the raw API response: does it contain a link object, ID, or
null? - Confirm you’re using the CMS’s expand/populate/include option.
- Verify the linked entry is published and readable.
- Check locale, preview, and permission settings.
- Make sure your query explicitly asks for the nested fields.
If you tell me which CMS you’re using and paste a sample query/response, I can point to the exact fix.