You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this scenario, I have a nested Document type that isn't a database indexed item.
Let's use Foo and Oof both needing access to the type of Bar.
file: schema.prisma
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = "{urlOmitted}"
}
generator nestjsDto {
provider = "prisma-generator-nestjs-dto"
output = "../src"
outputToNestJsResourceStructure = "true"
}
type Bar {
thing1 String
thing2 Int
thing3 Boolean
}
model Foo {
id String @id @default(auto()) @map("_id") @db.ObjectId
bar Bar
thing Int
}
model Oof {
id String @id @default(auto()) @map("_id") @db.ObjectId
bar Bar
thing String
}
Upon generation, an error is thrown Error: related model 'Bar' for 'Foo.bar' not found
npx prisma generate
Prisma schema loaded from prisma/schema.prisma
prisma:info Processing Model Foo
Error:
✔ Generated Prisma Client (3.14.0 | library) to ./node_modules/@prisma/client in 74ms
Error: related model 'Bar' for 'Foo.bar' not found
The text was updated successfully, but these errors were encountered:
In this scenario, I have a nested Document type that isn't a database indexed item.
Let's use
Foo
andOof
both needing access to the type ofBar
.file: schema.prisma
Upon generation, an error is thrown
Error: related model 'Bar' for 'Foo.bar' not found
The text was updated successfully, but these errors were encountered: