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
When rejectOnNotFound is used, chaining deeper into a related table still throws if it doesn't find anything #10642
Comments
Someone might say that this behaviour is correct-that prisma is intentionally using
If this is how it is intended, then it is a bad default IMHO, because in most cases you want the throw to only apply to a single level when chaining queries. Especially if you have a helper method which gets reused in multiple places. |
I also suffer from the same issue. I find it a bug because it throws |
There is definitely a bug, there's just no indication anywhere whether
I hope it's 2. because I really think this is not a good default as it disallows a bunch of usecases. |
I can confirm this bug. Thanks for the report. |
Can reproduce it with |
Bug description
rejectOnNotFound
should not cause chained queries to fail if they don't find an entity.It is best understood by looking at the reproduction example:
How to reproduce
Have a code like this:
Running this code using
ts-node pr.ts
prints out:Expected behavior
Expected output for me is this:
Without throwing any errors.
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: