-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Unify extending of type system #1261
Conversation
@@ -212,9 +181,6 @@ export function extendSchema( | |||
const extendTypeCache = Object.create(null); | |||
|
|||
// Get the root Query, Mutation, and Subscription object types. | |||
// Note: While this could make early assertions to get the correctly | |||
// typed values below, that would throw immediately while type system | |||
// validation with validateSchema() will produce more actionable results. |
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.
This comment is not relevant anymore since they're no any
cast here.
Moreover, the result of extending object type will always be an object type.
After a cursory read I think this looks great. However I'm going to hold off merging it while I'm investigating #1265 |
// Note: While this could make early assertions to get the correctly | ||
// typed values, that would throw immediately while type system | ||
// validation with validateSchema() will produce more actionable results. | ||
interfaces: interfaces ? () => (this.buildTypes(interfaces): any) : [], |
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.
Nice to avoid the lambda allocation if the AST defines no interfaces
Nice work |
It's a preparation for the #1095