How do you infer the type of a relations query?

I tried infer model and schema but it misses the relations created
2 Replies
msu
msuOP15mo ago
For example, I have calls with a lead relation but I can't get the inferred type to include the lead relation
Angelelz
Angelelz15mo ago
I usually just construct the type:
type User = InferSelectModel<users>;
type Post = InferSelectModel<posts>;

type UserWithPosts = User & { posts: Post[] };
type User = InferSelectModel<users>;
type Post = InferSelectModel<posts>;

type UserWithPosts = User & { posts: Post[] };
For example for a one-to-many relation
Want results from more Discord servers?
Add your server