-
-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(subschemas): improve delegation workflow
- refine SubschemaConfig type to allow using identical objects to merge different schemas and then delegate to those subschemas. - consolidate SchemaExecutionConfig type into SubschemaConfig type. - add separate subschemas, types, and typeDefs options to mergeSchemas to highlight different things that are being merged -- schemas options still works. - allow wrapSchema to take just a subschemaConfig as an argument, will apply the subschemas execution configuration and transforms to yield the appropriate delegating outer schema. - add rootValue to delegateToSchema options and move all other newish delegateToSchema options within the subSchemaConfig. rootValue is parallel in some ways to context, so ok to have at top level. - rename SubSchemaConfig => SubschemaConfig - - remove support for renaming types based on modification of an outer schema, this breaks when inner type is renamed and outer schema has interface not defined in inner schema. ExpandAbstractTypes currently handles this use case, but works only when the delegated result contains the correct typename. An alternative workflow would be to add the outer interface prior to renaming to each subschema and then merge interfaces. - remove resolversTransformResult property from transforms, no longer being used. - update docs! This change paves the way for annotating a result with a reference to the delegated schema. With a modified merged resolver, an outer merged schema could check to see if it received a partial result of a merged type and then merge the partial result with the necessary additional schemas defining the type.
- Loading branch information
Showing
16 changed files
with
282 additions
and
249 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.