Resolve missing types "Boolean", "String"#1355
Merged
trevor-scheer merged 4 commits intomasterfrom Jun 27, 2019
Merged
Conversation
A change to buildClientSchema removed some behavior that we depended on. Previously, with caching in place, basic types (Boolean, String, ...) were returned even if they didn't exist in typeMap. The "fix" was itself a breaking change, adding basic types that weren't previously added to the typeMap. Full discussion here: graphql/graphql-js@183ff32#r32971387 This commit addresses a couple issues: 1) Request the built in types from Engine 2) Disallow versions of graphql that include the broken fix The broken fix causes a regression for service:push. During the broken fix (graphql@14.2.1-14.3.0), ALL built in types are included during buildClientSchema (even if they're not part of the schema). This causes a hash mismatch between the pushed schema and the schema hash that Apollo Server recognizes.
abernix
requested changes
Jun 27, 2019
abernix
requested changes
Jun 27, 2019
Great catch @abernix, this fixes an issue with the version range previously wasn't parsed correctly by semver.
This was referenced Jun 27, 2019
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preface
A change to graphql's
buildClientSchemaremoved some behavior that we depended on. Previously, with caching in place, basic types (Boolean, String, ...) were returned even if they didn't exist in typeMap. The "fix" was itself a breaking change, adding basic types that weren't previously added to the typeMap.Full discussion here: graphql/graphql-js@183ff32#r32971387
Chain of events
14.2.0release, breaking our usage ofbuildClientSchemaRemove excessive cache inside buildClientSchema graphql/graphql-js#1677
14.2.1, which is itself a breaking changebuildClientSchema: Revert breaking change introduced in #1677 graphql/graphql-js#1808
14.3.1with this fix:buildClientSchema: include standard type only if it is used graphql/graphql-js#1809
Approach / Discussion
@justinanastos and I discovered with some digging that we depended on
buildClientSchemato fill in the missing built-in types for us (we were handing off an incomplete schema, but it would correct our error). We realized that we can request the built-in types and solve the problem on our end by passing a complete schema.This PR addresses a couple issues that stem from the ongoing graphql issue (and subsequent fixes):
graphql@14.2.1 - 14.3.0.Why exclude the range
14.2.1 - 14.3.0?The broken fix causes a regression for service:push. Through the version range of the broken fix, ALL built in types are included during
buildClientSchema(even if they're not part of the schema). This causes a hash mismatch between the pushed schema and the schema hash that Apollo Server recognizes.Fixes #1296
Fixes #1295
TODO:
*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.