I have a situation. We have built our Magento site as headless (data is provided from GQL). Category pages, PDP, catalog search result pages, etc all are headless except CMS pages because of product-related widgets.
We built all our components in Next JS with our business logic for the product query. However, because CMS page content with widgets is output as plain HTML via GQL, we cannot use our components meaning our business logic is ignored. It looks like we will have to do our logic in the PHTML again (redundant), which we want to avoid.
Has anyone done this in their project? If so, how did you avoid this situation?