-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve missing types "Boolean", "String" #1355
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 ([email protected]), 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that, as we discovered on our out-of-band call, spaces must be used in the version ranges in order to properly differentiate them from just general hyphens in version names, as I've "suggested" below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous comment!
Great catch @abernix, this fixes an issue with the version range previously wasn't parsed correctly by semver.
Preface
A change to graphql's
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
Chain of events
14.2.0
release, breaking our usage ofbuildClientSchema
Remove 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.1
with 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
buildClientSchema
to 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):
[email protected] - 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.