Question: Working with prisma JSON types

I've had this "thing" with prisma + TS after switching to it for a while so I was wondering how are you people properly parsing types of JSON fields prisma, suppose I have some model
model SomeModel {
id ...
name ...
properties Json
}
model SomeModel {
id ...
name ...
properties Json
}
and now I have a type for properties
type Properties = {
a: string;
b: number;
}
type Properties = {
a: string;
b: number;
}
how do you type the field when working with this data? 🤔
2 Replies
andersgee
andersgee•2y ago
This is kind of a non-answer but you should basically never use the Json type in the schema. Thats how people "solve" it :p
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server