Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
Prisma typescript type error when creating record

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
    }
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Found out I had installed prisma outside my project folder. I just deleted it and reinstalled it.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!