async function createSchedule() { return db.schedule.create({ data: { name: '', days: { create: [ { holiday: true, independentWorkDay: true, lessons: { create: [ { place: 'some place', type: 'lecture' satisfies LessonType, subject: { connect: { id: 12, // the important part that the type would have this subject's id. There's no such field in `Prisma.LessonCreateArgs` ofc, so I need to infer the type from this function }, }, }, ], }, }, ], }, }, })}
async function createSchedule() { return db.schedule.create({ data: { name: '', days: { create: [ { holiday: true, independentWorkDay: true, lessons: { create: [ { place: 'some place', type: 'lecture' satisfies LessonType, subject: { connect: { id: 12, // the important part that the type would have this subject's id. There's no such field in `Prisma.LessonCreateArgs` ofc, so I need to infer the type from this function }, }, }, ], }, }, ], }, }, })}
I want to get the type of the
Lesson
Lesson
of the shape in this function. so it has to look like this