We are trying to implement a dynamic page behavior that will resolve pages for non item existing routes like:
https://mywebsite/stores/store1/ (Stores exists as item but store1 not)
The idea was that: The the dynamic page route of Next.js (...path) will forward the request to layoutservice with item parameter: /stores/store1. And on backend side we would resolve the item to an existing item and enhance data from url to provide page layout service data.
But for now it looks like that Next.js is calling always the GraphQL endpoint /sitecore/api/graph/edge and that is the request url for the "layout" somehow? But to be honest, we currently not understand if the endpoint is used to access the layoutsource data, or if it is triggered in addition and just raising because of non existing item a graphql error.
Can someone explain how this works? And if our approach even make sense?