Not sure how isEmail
is intended to be used?
.mutation("add", {
input: z.object({
email: z.string().min(1).isEmail(), <----- ? this doesn't seem to work / throws an error
}),
async resolve({ ctx, input }) {
let user = await prisma.subscriber.create({
data: {
email: input.email,
},
});
return { email: input.email };
},
});
I thought isEmail would simply validate the input before getting it through the schema, but this doesn't seem to be the idea?