How can I check if a Structured Text field is blank

I can see the query filter to remove items if the structured text field is blank. But is there a way to know in code if it’s empty or not.

My usecase is this: I have a MDX field and a structured text field, and not all content fields has been migrated to the structured text, so I need to display the content if the structured text field is not available.

Is there a way to achieve this?

Hello @marvin.kome

As you said, the query parameter can eliminate blank Structured Text from being fetched on the graphQL end.

There is this PR here that offers a helper function to verify if a structured text is or isn’t empty on code, and i think it is exactly what you are looking for: Create isEmptyOrInvalid helper function by thomasverleye · Pull Request #22 · datocms/structured-text · GitHub