-
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.
Summary: ## Context In M2 we want to support defining a resolver that returns an interface, implemented by strong concrete types. The `modelResolver` field on a `ClientEdgeToClientObject` type is used in `RelayReader` when reading a client edge to verify that the object exists before reading its child fields. Previously, client edge nodes were structured as: ``` { ... 'modelResolver': {..} 'backingField': {..} 'linkedField': {..} ... } ``` This diff refactors them to: ``` { ... 'modelResolvers': { 'ConcreteTypeA': {..} 'ConcreteTypeB': {..} } 'backingField': {..} 'linkedField': {..} ... } ``` where the type of the `modelResolvers` field in runtime code is `{[string]: RelayResolver | RelayLiveResolver}`. There will only be one concrete type if the client edge points to a concrete object, i.e. ``` { ... 'modelResolvers': { 'ConcreteObjectType': {..} } 'backingField': {..} 'linkedField': {..} ... } ``` ## This diff Add model resolver nodes for client edges pointing to an interface (previously hardcoded to an empty object). Note: model resolvers for `ClientEdgeToClientUnion` nodes are not yet generated here. Reviewed By: captbaritone Differential Revision: D54137384 fbshipit-source-id: 8f52634109eec3c9f71acb15c0e1228972ce145a
- Loading branch information
1 parent
568d47d
commit ba5e48f
Showing
10 changed files
with
193 additions
and
87 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
Oops, something went wrong.