Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
}]],
"plugins": [
"./resources/inline-invariant",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-flow-strip-types",
["@babel/plugin-transform-classes", {"loose": true}],
["@babel/plugin-transform-destructuring", {"loose": true}],
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"devDependencies": {
"@babel/cli": "7.2.0",
"@babel/core": "7.2.2",
"@babel/plugin-proposal-class-properties": "7.2.1",
"@babel/plugin-transform-flow-strip-types": "7.2.0",
"@babel/polyfill": "7.0.0",
"@babel/preset-env": "7.2.0",
Expand Down
11 changes: 6 additions & 5 deletions src/type/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class GraphQLSchema {
_directives: $ReadOnlyArray<GraphQLDirective>;
_typeMap: TypeMap;
_implementations: ObjMap<Array<GraphQLObjectType>>;
_possibleTypeMap: ?ObjMap<ObjMap<boolean>>;
_possibleTypeMap: ObjMap<ObjMap<boolean>>;
// Used as a cache for validateSchema().
__validationErrors: ?$ReadOnlyArray<GraphQLError>;
// Referenced by validateSchema().
Expand All @@ -105,6 +105,8 @@ export class GraphQLSchema {
if (config && config.assumeValid) {
this.__validationErrors = [];
} else {
this.__validationErrors = undefined;

// Otherwise check for common mistakes during construction to produce
// clear and early error messages.
invariant(
Expand Down Expand Up @@ -161,6 +163,8 @@ export class GraphQLSchema {
// Storing the resulting map for reference by the schema.
this._typeMap = typeMap;

this._possibleTypeMap = Object.create(null);

// Keep track of all implementations by interface name.
this._implementations = Object.create(null);
for (const typeName of Object.keys(this._typeMap)) {
Expand Down Expand Up @@ -215,10 +219,7 @@ export class GraphQLSchema {
abstractType: GraphQLAbstractType,
possibleType: GraphQLObjectType,
): boolean {
let possibleTypeMap = this._possibleTypeMap;
if (!possibleTypeMap) {
this._possibleTypeMap = possibleTypeMap = Object.create(null);
}
const possibleTypeMap = this._possibleTypeMap;

if (!possibleTypeMap[abstractType.name]) {
const possibleTypes = this.getPossibleTypes(abstractType);
Expand Down
3 changes: 2 additions & 1 deletion src/validation/ValidationContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type VariableUsage = {|
export class ASTValidationContext {
_ast: DocumentNode;
_errors: Array<GraphQLError>;
_fragments: ObjMap<FragmentDefinitionNode>;
_fragments: ?ObjMap<FragmentDefinitionNode>;
_fragmentSpreads: Map<SelectionSetNode, $ReadOnlyArray<FragmentSpreadNode>>;
_recursivelyReferencedFragments: Map<
OperationDefinitionNode,
Expand All @@ -56,6 +56,7 @@ export class ASTValidationContext {
constructor(ast: DocumentNode): void {
this._ast = ast;
this._errors = [];
this._fragments = undefined;
this._fragmentSpreads = new Map();
this._recursivelyReferencedFragments = new Map();
}
Expand Down
19 changes: 0 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,6 @@
"@babel/traverse" "^7.1.0"
"@babel/types" "^7.0.0"

"@babel/helper-create-class-features-plugin@^7.2.1":
version "7.2.2"
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.2.2.tgz#aac79552e41c94716a804d371e943f20171df0c5"
integrity sha512-Q4qZE5wS3NWpOS6UV9yhIS/NmSyf2keF0E0IwDvx8WxTheVopVIY6BSQ/0vz72OTTruz0cOA2yIUh6Kdg3qprA==
dependencies:
"@babel/helper-function-name" "^7.1.0"
"@babel/helper-member-expression-to-functions" "^7.0.0"
"@babel/helper-optimise-call-expression" "^7.0.0"
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/helper-replace-supers" "^7.1.0"

"@babel/helper-define-map@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz#3b74caec329b3c80c116290887c0dd9ae468c20c"
Expand Down Expand Up @@ -255,14 +244,6 @@
"@babel/helper-remap-async-to-generator" "^7.1.0"
"@babel/plugin-syntax-async-generators" "^7.2.0"

"@babel/plugin-proposal-class-properties@7.2.1":
version "7.2.1"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.2.1.tgz#c734a53e0a1ec40fe5c22ee5069d26da3b187d05"
integrity sha512-/4FKFChkQ2Jgb8lBDsvFX496YTi7UWTetVgS8oJUpX1e/DlaoeEK57At27ug8Hu2zI2g8bzkJ+8k9qrHZRPGPA==
dependencies:
"@babel/helper-create-class-features-plugin" "^7.2.1"
"@babel/helper-plugin-utils" "^7.0.0"

"@babel/plugin-proposal-json-strings@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317"
Expand Down