-
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.
Support non-string identifying argument values
Summary:Note: this is inspired by and partially based on iamchenxin's work in #767 and #844. Thanks for the head start! Relay currently assumes that identifying argument values are strings (numbers *sort* of work, but not really). This builds on #894 (which added support to the plugin for parsing/printing literal InputObjects) by allowing identifying arguments to be basically anything - boolean, number, string, or array/object of the the same. Key changes include: - Change the `CallValue` type from mixed to an explicit list of the supported types - Change `forEachRootCallArg` to return both the literal JS value of the argument as well as a serialized key - Change all callers of `forEachRootCallArg` (and some places that manually inspected the identifying arg) to correctly choose between the identifying argument value (i.e. when constructing a query with it) or the identifying argument key (for use with `RelayRecordStore.{putDataID,getDataID}`). - Added tests that the writer correctly creates root records with numeric/object identifying argument values. Closes #895 Reviewed By: yungsters Differential Revision: D3003201 Pulled By: josephsavona fb-gh-sync-id: 43ffbbd37e8d2bd8c0abe2cb792ad8959efb7a42 shipit-source-id: 43ffbbd37e8d2bd8c0abe2cb792ad8959efb7a42
- Loading branch information
1 parent
0285a1e
commit 38beb23
Showing
21 changed files
with
510 additions
and
94 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
Oops, something went wrong.