GraphQL returning random empty content[] in contentPreview and Production environments #support

Describe the issue:

Every once in a while pages are empty in our site both in content preview and production environment. Build process has no logs of error messages, we simply get an empty page where there’ s nothing in the body because GraphQL returned content:[]

The latest scenario we experienced for this was for a specific page that has two locales: de-AT and de-DE. The de-DE locale showed perfectly, while the “de-AT” locale was blank. When inspecting the page-data.json stored in our s3 bucket, we saw that the GraphQL query returned content:[]


Forcing a chance on the model (slug change) and building for prod, then undoing the change, and leaving original slug, finally rendered the content. But this doesn’t help us understand why there was an content:[] to begin with?

(Optional) Do you have any sample code you can provide?

None, since it happens randomly for different pages, and randomly in either prod or content-preview.

Could you help us with this? It’s very frustrating since we can’t seem to pinpoint where the error is happening.

Hey @technology ,

It looks like content in this case is a Modular Content Field, correct? What does your query for that field look like? Are there any filters being applied?

Another thought: Could it have been something to do with the de-AT locale not having been published yet (maybe just saved), and if that was your default locale, the record might come back blank unless you specifically request the de-DE locale? Localization: Fetching Localized Content

(To be safe, you can fetch all of locales together too: Localization: Fetching all locales)

Just throwing some possibilities out there. If you could please provide the query you’re using, and what your fetcher looks like, we can keep investigating?

Thanks and sorry about that!

Hi @roger ! Yup, I’ll send the query we are doing over through email :+1: thank you!