Skip to content
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

Merged
merged 1 commit into from
Feb 28, 2018
Merged

Conversation

IvanGoncharov
Copy link
Member

It's a preparation for the #1095

@@ -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.
Copy link
Member Author

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.

@leebyron
Copy link
Contributor

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) : [],
Copy link
Contributor

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

@leebyron leebyron merged commit a62eea8 into graphql:master Feb 28, 2018
@leebyron
Copy link
Contributor

Nice work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants