vegardit / prisma-generator-nestjs-dto

Generates NestJS DTO classes from Prisma Schema
Apache License 2.0
268 stars 73 forks source link

Support Types in Mongodb Prisma #127

Open masterbater opened 2 years ago

n0t-r0n1t commented 1 year ago

In case of Enum Array it does @ApiProperty({ enum: X[] }) wheras it should be @ApiProperty({ enum: [X] })

gwesterman commented 1 year ago

I think these are two different issues.

The issue reported by @n0t-r0n1t still persists, I'm currently running into the same problem and it warrants its own ticket.

The original issue in this topic is something I've already brought up with another generator library for Prisma.

Starting with version 3.10.0 Prisma started supporting embedded documents in MongoDB.

This requires declaring a type in the schema like this:

// schema.prisma

model Product {
  id     String  @id
  name   String
  photos Photo[]
}

type Photo {
  height Int
  width  Int
  url    String
}

This will cause the following error to be thrown:

Error: related model 'Photo' for 'Product.photos' not found
shankiflang commented 1 year ago

Same problem for me, any help ? image result : Error: related model 'TokenData' for 'Community.tokenData' not found