prisma-factory
prisma-factory copied to clipboard
support ModelUncheckedCreateInput type
UncheckedInputTypes allow us to pass ids to the prisma model rather than objects An example:
Currently we connect,
export const createConnection = (userId, type) => {
const Factory = createConnectionFactory({});
return Factory.create({
type,
user: {
connect: {
id: userId,
},
},
});
};
An alternative when ConnectionUncheckedCreateInput
type is added
export const createConnection = (userId, type) => {
const Factory = createConnectionFactory({});
return Factory.create({
userId,
type,
});
};
I had this hurdle myself. And it looks like a good solution.