-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate missing required fields into errorResponseFields (#4807)
Summary: This represents the last major step in consolidating how field errors are modeled on Snapshot. Here we move missing required fields into the existing `errorResponseFields` (which should probably get renamed at some point) and are now directly stored in their event shape, rather than needing an intermediate shape. This comes with a few small changes: 1. The decision of if we should throw or not is now guided by the actual event rather than just the presence of `throwOnFieldError` on the fragment being read. This is important because we may inherit events from resolvers that we read. 2. We now throw individual errors based on the first field error we encounter rather than throwing a composite error with lots of metadata attached. In practice I think this is probably better. Many errors are likely uncommon, and having an informative error message is likely to result in a more actionable error report (error reporting infra won't easily pick up the metadata). Advanced users are free to use the FieldLogger to build more advanced errors if they wish 3. We dropped the feature where cascading missing required field errors were not logged. We now log all required field errors (even if some are the result of previous errors) but only the first error will throw. Pull Request resolved: #4807 Reviewed By: itamark Differential Revision: D63563076 Pulled By: captbaritone fbshipit-source-id: bf5b400b0ff143378a8b04f3bb1d74b6f40e0ab3
- Loading branch information
1 parent
6e1a5c6
commit 535f35c
Showing
32 changed files
with
467 additions
and
623 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.