P
Prisma3mo ago
keii

Reason why relation is giving an error when id is provided

Hello im trying to create a new row but even when the id is provided it gives an error
2024-05-01 23:58:55 Invalid `prisma.entryAlternativeTitle.create()` invocation:
2024-05-01 23:58:55
2024-05-01 23:58:55 {
2024-05-01 23:58:55 data: {
2024-05-01 23:58:55 entryId: 11,
2024-05-01 23:58:55 languageId: 326,
2024-05-01 23:58:55 title: "Ο Χάρι Πότερ και η Φιλοσοφική Λίθος",
2024-05-01 23:58:55 + entry: {
2024-05-01 23:58:55 + create: EntryCreateWithoutAlternativeTitlesInput | EntryUncheckedCreateWithoutAlternativeTitlesInput,
2024-05-01 23:58:55 + connectOrCreate: EntryCreateOrConnectWithoutAlternativeTitlesInput,
2024-05-01 23:58:55 + connect: EntryWhereUniqueInput
2024-05-01 23:58:55 + }
2024-05-01 23:58:55 }
2024-05-01 23:58:55 }
2024-05-01 23:58:55
2024-05-01 23:58:55 Argument `entry` is missing.
2024-05-01 23:58:55 Invalid `prisma.entryAlternativeTitle.create()` invocation:
2024-05-01 23:58:55
2024-05-01 23:58:55 {
2024-05-01 23:58:55 data: {
2024-05-01 23:58:55 entryId: 11,
2024-05-01 23:58:55 languageId: 326,
2024-05-01 23:58:55 title: "Ο Χάρι Πότερ και η Φιλοσοφική Λίθος",
2024-05-01 23:58:55 + entry: {
2024-05-01 23:58:55 + create: EntryCreateWithoutAlternativeTitlesInput | EntryUncheckedCreateWithoutAlternativeTitlesInput,
2024-05-01 23:58:55 + connectOrCreate: EntryCreateOrConnectWithoutAlternativeTitlesInput,
2024-05-01 23:58:55 + connect: EntryWhereUniqueInput
2024-05-01 23:58:55 + }
2024-05-01 23:58:55 }
2024-05-01 23:58:55 }
2024-05-01 23:58:55
2024-05-01 23:58:55 Argument `entry` is missing.
schema:
model EntryAlternativeTitle {
id Int @id @default(autoincrement()) @db.UnsignedInt
entryId Int @db.UnsignedInt
entry Entry @relation(fields: [entryId], references: [id], onDelete: Cascade)
countryId Int? @db.UnsignedInt
country Country? @relation(fields: [countryId], references: [id], onDelete: Cascade)
languageId Int? @db.UnsignedInt
language Language? @relation(fields: [languageId], references: [id], onDelete: Cascade)
title String

createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
}
model EntryAlternativeTitle {
id Int @id @default(autoincrement()) @db.UnsignedInt
entryId Int @db.UnsignedInt
entry Entry @relation(fields: [entryId], references: [id], onDelete: Cascade)
countryId Int? @db.UnsignedInt
country Country? @relation(fields: [countryId], references: [id], onDelete: Cascade)
languageId Int? @db.UnsignedInt
language Language? @relation(fields: [languageId], references: [id], onDelete: Cascade)
title String

createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
}
Solution:
some wierd artifact i removed node_modules and prisma generated and it fixed it
Jump to solution
1 Reply
Solution
keii
keii3mo ago
some wierd artifact i removed node_modules and prisma generated and it fixed it