Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

248
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda