diff --git a/CHANGELOG.md b/CHANGELOG.md index 37d4312b33..475ab931b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ - `apollo-env` - - `apollo-graphql` - - + - Use reference-equality, rather than `Function.prototype.name` string comparison, when omitting validation rules within `buildSchemaFromSDL`. [#1551](https://github.com/apollographql/apollo-tooling/pull/1551) - `apollo-language-server` - Replace old mutation used for checking partial service schemas to use `checkPartialSchema` [#1539](https://github.com/apollographql/apollo-tooling/pull/1539) - Remove old federation-info provider [#1489](https://github.com/apollographql/apollo-tooling/pull/1489) diff --git a/packages/apollo-graphql/src/schema/buildSchemaFromSDL.ts b/packages/apollo-graphql/src/schema/buildSchemaFromSDL.ts index 308803d2ed..2caae67a47 100644 --- a/packages/apollo-graphql/src/schema/buildSchemaFromSDL.ts +++ b/packages/apollo-graphql/src/schema/buildSchemaFromSDL.ts @@ -25,6 +25,13 @@ import { isDocumentNode, isNode } from "../utilities/graphql"; import { GraphQLResolverMap } from "./resolverMap"; import { GraphQLSchemaValidationError } from "./GraphQLSchemaValidationError"; import { specifiedSDLRules } from "graphql/validation/specifiedRules"; +import { + KnownTypeNamesRule, + UniqueDirectivesPerLocationRule +} from "graphql/validation"; +// Currently, this PossibleTypeExtensions rule is experimental and thus not +// exposed directly from the rules module above. This may change in the future! +import { PossibleTypeExtensions } from "graphql/validation/rules/PossibleTypeExtensions"; import { mapValues, isNotNullOrUndefined } from "apollo-env"; export interface GraphQLSchemaModule { @@ -33,13 +40,13 @@ export interface GraphQLSchemaModule { } const skippedSDLRules = [ - "PossibleTypeExtensions", - "KnownTypeNames", - "UniqueDirectivesPerLocation" + PossibleTypeExtensions, + KnownTypeNamesRule, + UniqueDirectivesPerLocationRule ]; const sdlRules = specifiedSDLRules.filter( - rule => !skippedSDLRules.includes(rule.name) + rule => !skippedSDLRules.includes(rule) ); export function modulesFromSDL(