Quramy / prisma-fabbrica

Prisma generator to define model factory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Callback before or after create / buildCreateInput

Quramy opened this issue · comments

Feature like https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#default-callbacks

const PostFactory = definePostFactory({
  defaultData: {
    author: UserFactory,
  },
  onAfterCreate: async (created) => {
    await something(created);
  },
});
  • onAfterBuild, onBeforeCreate, onAfterCreate is an optional callback function
  • It accepts created data object

I would very much like this. What do you think the effort level would be? Would this be an easy thing for someone to contribute?