Repository navigation
feat(client): Add findUniqueOrThrow and findFirstOrThrow methods - #13920
Merged
Merged
Conversation
SevInf
commented
Jun 20, 2022
SevInf
commented
Jun 20, 2022
SevInf
commented
Jun 20, 2022
SevInf
force-pushed
the
deprecate-rejectOnNotFound
branch
from
June 20, 2022 18:06
d27f684 to
72b0ee7
Compare
danstarns
reviewed
Jun 21, 2022
millsp
reviewed
Jun 21, 2022
millsp
reviewed
Jun 21, 2022
Member
|
Overall it looks very good to me. I agree with Pierre that it would be nice to avoid duplicating types. |
millsp
reviewed
Jun 21, 2022
millsp
reviewed
Jun 21, 2022
millsp
reviewed
Jun 21, 2022
millsp
approved these changes
Jun 21, 2022
aqrln
approved these changes
Jun 21, 2022
Member
|
Snapshots need to be updated |
Replacement for `rejectOnNotFound`. Introduces new gategory of model actions: client-only actions, that are not defined on DMMF, but exist solely on the client and work by wrapping the requests to the existing DMMF-defined action and adding logic before or after it's performed. Why do wrap request function specifically, and not, say, orginal methods themselves. Two reasons: - To be 1:1 replacement to `rejectOnNotFound`, new methods should return `PrismaPromise` and do not start the query until awaited - Fluent API needs to work with new methods the same way it did with originals Deprecate `rejectOnNotFound`. Deprecation warinings will be shown in editors (via jsdoc comments) as well as logged to console once per model/action combination Close #12159
Co-authored-by: pierre <[email protected]>
SevInf
force-pushed
the
deprecate-rejectOnNotFound
branch
from
June 22, 2022 09:02
5706eec to
206bc93
Compare
aqrln
approved these changes
Jun 22, 2022
This was referenced Nov 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replacement for
rejectOnNotFound. Introduces new gategory of modelactions: client-only actions, that are not defined on DMMF, but exist
solely on the client and work by wrapping the requests to the existing
DMMF-defined action and adding logic before or after it's performed.
Why do wrap request function specifically, and not, say, orginal methods
themselves. Two reasons:
rejectOnNotFound, new methods should returnPrismaPromiseand do not start the query until awaitedoriginals
Deprecate
rejectOnNotFound. Deprecation warinings will be shown ineditors (via jsdoc comments) as well as logged to console once per
model/action combination
Close #12159