export const createStudent: CreateStudent<CreateStudentPayload, Student> = async (args, context) => {
if (!context.user) {
throw new HttpError(401);
}
return context.entities.Student.create({
data: {
name: args.name,
number: 11,
class: { connect: { teacherId: context.user.id }}
}
})
}
export const createStudent: CreateStudent<CreateStudentPayload, Student> = async (args, context) => {
if (!context.user) {
throw new HttpError(401);
}
return context.entities.Student.create({
data: {
name: args.name,
number: 11,
class: { connect: { teacherId: context.user.id }}
}
})
}