Hi everyone,
I recently checked the documentation on dynamic pages and the commercetools extension repository (https://github.com/FrontasticGmbH/extension-commercetools).
There is one point I don’t understand right now: why does a dynamic page defines a data source, even though the dynamic page handler already loads the necessary data?
For example the product details page. The dynamic page handler (https://github.com/FrontasticGmbH/extension-commercetools/blob/master/index.ts) uses the ProductApi in line 65 to retrieve the product data and add it to the response. Furthermore the schema for the dynamic page additionally defined the data source type “frontastic/product”, which loads the product data too in line 216 (https://github.com/FrontasticGmbH/extension-commercetools/blob/master/index.ts).
So why is it necessary to load the data in the dynamic page handler and define a data source for the dynamic page too, which loads the same data? What point am I missing?
Thank you and kind regards,
Torben