How to use mock data of a Custom Type when developing locally?

Hi Prismic team,

Recently our team switched from the Legacy Builder to working with the Slice Machine. Having the models & types locally when developing a feature is way better now. Although we still have a challenge which we don't know how to fix.

Our setup is a NextJs application. Also we have Custom Types and a few Slices.
So a custom type is the ContentPage. It contains a few fields like 'meta_description', 'page_title' etc. Also it contains a list 'blocks' which contains Slices.

If we make changes to the Custom Type, we have to push them first to Prismic before we can enter content. This doesn't work when 2 developers are working at the same time in feature branches and want to make changes in the same Custom Type.
A fix for this could be the option of mock data for all the fields of a Custom Type. Actually I don't see a way of how this can work in our setup.

Our wish is: when developing on a feature and making changes in a Custom Type, you can add mock data locally to be able to test the feature. When the feature is merged in main, it can be pushed to Prismic.

Is this already possible or do you have other suggestions how this should work/can be fixed?

Thanks in advance!

Hello @roelfjan

Thanks for reaching out to us.

A the moment, it is not available, and this is a current issue with the Slice Machine when multiple developers are working on the same project. My team is already working to improve this feature.

Thanks,
Priyanka

1 Like