coremedia-headless-client-react

CoreMedia Headless Stitching Server Documentation

Documentation / Concepts / Mocking


Mocking in Detail

File System Structure

The mocking server uses a base directory to read and record mock files from.

mocks/
├── graphql/
    └── site-id-folder/
        └── graphql-query-folder/
            └── post_$id=Dresses.json
            └── post_.json
    

Pre-fabricated Mocks

If you start the mocking server with pnpm start the base directory to read the mocks is set to mocks.

With the pre-fabricated mock files at least the homepage of the Calista (en-US) site works. The products displayed on the homepage have synthetically generated texts. Please note, that their pictures are delivered by the CMS (CoreMedia Asset Management).

Apart from the homepage you can also navigate to a category page and/or a product detail page. Pure content pages work anyway. This functionality is intended to be able to try out all essential page types without the need for a commerce system interaction.

You are free to extend the set of pre-fabricated mocks by record more files in greater depth or to support other sites. Instructions on how to do this can be found here Installation and Start (Mock Server). A commerce connection is of course necessary for this.

Btw. the Corporate site can also be used because there is no interaction with the commerce system (no need for mocking).