-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
This issue is a follow-up to an ongoing problem with breaking changes in buildClientSchema.
A breakdown of events
v<14.2.0:buildClientSchemapulls in only the built-in scalar types that are referenced within the schema.v14.2.0:buildClientSchemadoesn't pull in any built-in scalar types. (original breaking change)v14.2.1-14.3.0:buildClientSchemapulls in all of the built-in scalar types, whether they're referenced within the schema or not. The fix addressed one issue, but introduced another and added unintended behavior.14.3.1-14.4.1(latest):buildClientSchemadoesn't add any built-in scalars, meaning the schema must be provided complete. We previously depended on pre-14.2.0 behavior, this is a break that we could only work around by pulling in the missing scalars ourselves before callingbuildClientSchema.
History and related links
- Remove excessive cache inside buildClientSchema #1677 - (introduced breaking change)
- buildClientSchema: Revert breaking change introduced in #1677 #1808 - attempt to correct breaking change, but introduced new behavior
- buildClientSchema: include standard type only if it is used #1809 - undoes previous behavior, but doesn't pull in missing scalars as before
- Lots of discussion around the issue: 183ff32#r32971387
- Resolve missing types "Boolean", "String" apollographql/apollo-tooling#1355
Reproduction
https://github.com/trevor-scheer/buildClientSchema-changes
Install and run
yarn
node index.js
The included schema for demonstration intentionally leaves out all built-in types in order to show how behavior changed over time. There is a field in the schema which depends on the Int type.