I ‘m using prisma with MySql.
When I try to create a new record (School) I get a type error in console.
I’m using a framework called Remix.run too, but it shouldn’t be the problem.
I’ve tried using mongoDB too, but i got the same type error.
Error
251 console.log(info);
252 });
253 let data = {school_code: key, otp: code};
→ 254 await db.schools.create({
data: {
school_code: 'ISP0TMORECNJS9TB',
~~~~~~~~~~~
otp: 'EMI5DU'
}
})
Unknown arg `school_code` in data.school_code
for type schoolsCreateInput.Available args:
type schoolsCreateInput {
id ? : String
v ? : Int | Null
otp: String
}
Prisma schema
datasource db {
provider = "mysql"
url = "mysql://root@localhost:3306/myeducatio"
}
model schools {
otp String @db.Text
school_code String @id
}
Code
Method 1
let data: any = {
school_code: key,
otp: code
};
await db.schools.create({
data,
});
Method 2
await db.schools.create({
data: {
school_code: key,
otp: code
}
});