Fredrik Lindberg
07/28/2022, 8:32 AMFredrik Lindberg
07/28/2022, 8:32 AMFredrik Lindberg
07/28/2022, 8:33 AMFredrik Lindberg
07/28/2022, 8:33 AMFredrik Lindberg
07/28/2022, 8:36 AMnikolasburk
QuestionAnswer where you have two modes of linking the new QuestionAnswer to a `Question`:
• directly set the questionId
• use a nested write via the question relation field
Because Prisma Client doesn’t know upfront which of the two you’ll use, it makes both fields optional in the context of a create query.
Does this help? 🙂nikolasburk
questionId nor the question fields, so TypeScript and Prisma Client do prevent you from creating a QuestionAnswer without a Question.Fredrik Lindberg
07/28/2022, 11:44 AMnikolasburk
create queries? Isn’t the most important thing to get a TS error when you create a new QuestionAnswer that doesn’t have Question. What exactly is the value in having questionId not be optional?Fredrik Lindberg
07/28/2022, 12:22 PMFredrik Lindberg
07/28/2022, 12:24 PMFredrik Lindberg
07/28/2022, 12:26 PMnikolasburk
Fredrik Lindberg
07/28/2022, 12:36 PMFredrik Lindberg
07/28/2022, 1:35 PMFredrik Lindberg
07/28/2022, 3:54 PM