-
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.
Handle missing fields in readUpdatableQuery/Fragment
Summary: # Why * Currently, if one reads a field, like `node(id: 4)`, in a typesafe updater, if that linked field is undefined in the store, the user will receive `undefined`. * This is true even if the user has provided a missing field handler that could provide that field. * This is annoying, because it violates users' expectations. # Fix * In `createUpdatableProxy`, whenever a field is read and is undefined, we attempt to have missing field handlers provide that record. * This requires passing the missing field handlers from where they are defined (e.g. on the environment) through to `RelayRecordSourceProxy`, etc. Reviewed By: alunyov Differential Revision: D40840474 LaMa Project: L1125407 fbshipit-source-id: 66df283e67a079b82a392950ef316b4054a9e38e
- Loading branch information
1 parent
6092ddb
commit c0d0198
Showing
14 changed files
with
634 additions
and
15 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
109 changes: 109 additions & 0 deletions
109
...s/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTestMissingFieldsQuery.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.