Performing a GraphQL query inside the htmlSerializer

For my website I would like to replace in all rich text contents some abbreviations with a <span class="abbrevation">%abbrevation%</span> structure.

For this I was thinking of using the htmlSerializer function.

The problem is now that the list of abbreviations is pretty big (about 200) and needs to also be maintained on prismic, in a designated content type.

How can I perform a GraphQL query inside the htmlSerializer function also with thinking about performance and build speed.

Hi Tudor,

Unfortunately, it's not possible to do queries inside the HTMLSerializer as it is never called as an async function.


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.