diff --git a/docs/source/testing/mocking.md b/docs/source/testing/mocking.md index a3051c16483..db933a4e7e0 100644 --- a/docs/source/testing/mocking.md +++ b/docs/source/testing/mocking.md @@ -187,11 +187,11 @@ server.listen().then(({ url }) => { ## Mocking a schema using introspection -The GraphQL specification allows clients to introspect the schema with a [special set of types and fields](https://facebook.github.io/graphql/#sec-Introspection) that every schema must include. The results of a [standard introspection query](https://github.com/graphql/graphql-js/blob/master/src/utilities/introspectionQuery.js) can be used to generate an instance of GraphQLSchema which can be mocked as explained above. +The GraphQL specification allows clients to introspect the schema with a [special set of types and fields](https://facebook.github.io/graphql/#sec-Introspection) that every schema must include. The results of a [standard introspection query](https://github.com/graphql/graphql-js/blob/master/src/utilities/getIntrospectionQuery.js) can be used to generate an instance of GraphQLSchema which can be mocked as explained above. This helps when you need to mock a schema defined in a language other than JS, for example Go, Ruby, or Python. -To convert an [introspection query](https://github.com/graphql/graphql-js/blob/master/src/utilities/introspectionQuery.js) result to a `GraphQLSchema` object, you can use the `buildClientSchema` utility from the `graphql` package. +To convert an [introspection query](https://github.com/graphql/graphql-js/blob/master/src/utilities/getIntrospectionQuery.js) result to a `GraphQLSchema` object, you can use the `buildClientSchema` utility from the `graphql` package. ```js const { buildClientSchema } = require('graphql'); diff --git a/packages/apollo-federation/src/directives.ts b/packages/apollo-federation/src/directives.ts index 4fabe07119b..dfd723c002e 100644 --- a/packages/apollo-federation/src/directives.ts +++ b/packages/apollo-federation/src/directives.ts @@ -23,48 +23,40 @@ import { export const KeyDirective = new GraphQLDirective({ name: 'key', - description: '', locations: [DirectiveLocation.OBJECT, DirectiveLocation.INTERFACE], args: { fields: { type: GraphQLNonNull(GraphQLString), - description: '', }, }, }); export const ExtendsDirective = new GraphQLDirective({ name: 'extends', - description: '', locations: [DirectiveLocation.OBJECT, DirectiveLocation.INTERFACE], }); export const ExternalDirective = new GraphQLDirective({ name: 'external', - description: '', locations: [DirectiveLocation.OBJECT, DirectiveLocation.FIELD_DEFINITION], }); export const RequiresDirective = new GraphQLDirective({ name: 'requires', - description: '', locations: [DirectiveLocation.FIELD_DEFINITION], args: { fields: { type: GraphQLNonNull(GraphQLString), - description: '', }, }, }); export const ProvidesDirective = new GraphQLDirective({ name: 'provides', - description: '', locations: [DirectiveLocation.FIELD_DEFINITION], args: { fields: { type: GraphQLNonNull(GraphQLString), - description: '', }, }, }); diff --git a/packages/apollo-federation/src/service/printFederatedSchema.ts b/packages/apollo-federation/src/service/printFederatedSchema.ts index 2b44e538a7a..53b0bea2e33 100644 --- a/packages/apollo-federation/src/service/printFederatedSchema.ts +++ b/packages/apollo-federation/src/service/printFederatedSchema.ts @@ -342,7 +342,7 @@ function printDescription( | GraphQLUnionType, indentation: string = '', ): string { - if (!def.description) { + if (def.description == null) { return ''; } diff --git a/packages/apollo-federation/src/types.ts b/packages/apollo-federation/src/types.ts index d73e1aeb687..453835b5943 100644 --- a/packages/apollo-federation/src/types.ts +++ b/packages/apollo-federation/src/types.ts @@ -76,7 +76,6 @@ export const entitiesField: GraphQLFieldConfig = { type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(AnyType))), }, }, - description: '', resolve(_source, { representations }, context, info) { return representations.map((reference: { __typename: string } & object) => { const { __typename } = reference; diff --git a/packages/apollo-server-integration-testsuite/src/index.ts b/packages/apollo-server-integration-testsuite/src/index.ts index 21a65212ca9..ccfe6891bd4 100644 --- a/packages/apollo-server-integration-testsuite/src/index.ts +++ b/packages/apollo-server-integration-testsuite/src/index.ts @@ -10,7 +10,7 @@ import { GraphQLError, GraphQLNonNull, GraphQLScalarType, - introspectionQuery, + getIntrospectionQuery, BREAK, DocumentNode, getOperationAST, @@ -620,7 +620,7 @@ export default (createApp: CreateAppFunc, destroyApp?: DestroyAppFunc) => { app = await createApp(); const req = request(app) .post('/graphql') - .send({ query: introspectionQuery }); + .send({ query: getIntrospectionQuery() }); return req.then(res => { expect(res.status).toEqual(200); expect(res.body.data.__schema.types[0].fields[0].name).toEqual(