New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema validator is not validating optionality of relations on both ends #3747
Comments
Hey @Frozen666, can you share what that entry will look like in the database? |
I can confirm this issue, looks like a validation bug to me. In the schema, the We will need to reject this schema in the validation step as it is clear invalid here. Reproduction can be narrowed down to having a 1 record in the User table with that schema and opening Prisma studio. |
create
field even if the relation is required
Internal Note: I don't think this is a Prisma schema validation bug. This is simply our feature for required virtual relation fields. This feature is under dicussion though. If we keep the feature the Query Engine would have to reject the given creation query as no address is provided. |
We decided to remove the feature for required virtual relation fields as it exposes those issues mentioned here. This is done in PR. |
Hi Prisma Team! My Prisma Client just crashed. This is the report:
Versions
Error
It is possible to create an entry with an undefined
create
field even if the relation is required. The compiler will not complain, the entry will be created on the database, but the server will crash on.findMany
Reproduction
(using modified https://github.com/prisma/prisma-examples/tree/master/typescript/graphql)
schema.prisma:
creation query:
Any
user.findMany
invocation will then crash afterwards. As an example the output after looking atUser
in Prisma Studio:Logs
The text was updated successfully, but these errors were encountered: