Felipe Paz
07/22/2022, 6:23 PMtype UserIntensitySetting {
id: UUID! @id
category: WorkoutCategory!
historicalIntensitySettings: [HistoricalIntensitySetting!]! @relation(onDelete: CASCADE)
user: User!
createdAt: DateTime! @createdAt
}
So, I can do this
... await context.prisma.userIntensitySetting({ id: 'asdf-basdf-waaa-234' });
The problem is I'd like to do this query
... await context.prisma.userIntensitySetting({ category: 'strength' });
But I got an error saying this field is not in the schema. My question is: how could I do this query and use other fields beside the id field?Aladin
07/23/2022, 4:55 AMAladin
07/23/2022, 4:55 AMAladin
07/23/2022, 4:55 AMfindUnique
you'd use findFirst
Aladin
07/23/2022, 4:56 AMNurul
07/25/2022, 3:50 PMfindUnique
query you can only refer to fields which has @unique
attribute.
Are you using Prisma1?Aladin
07/26/2022, 12:51 AM