Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Adjust test to not use deprecated `introspectionQuery` constant.

Instead, use `getIntrospectionQuery` instead, which has been around since
before [email protected], thus within our supported version ranges.

* Adjust documentation links for moved `introspectionQuery` page.

This file now lives at `getIntrospectionQuery`.

* Applying upstream modification to `printDescription`.

I'm assuming we'll want to keep this change which was also applied upstream,
though I'm not sure what our longer term plans are for keeping up with these
changes.

Ref: https://github.com/graphql/graphql-js/pull/2177/files#diff-71ba52e9c625f826d2b0df2963c8633aR320

* Remove empty descriptions which will be included in SDL w/graphql@15.

In `graphql@15`, empty descriptions are intentionally included in the SDL
output.  In order to be excluded entirely, they must be absent (or `null`).

Ref: graphql/graphql-js#2177

Apollo-Orig-Commit-AS: apollographql/apollo-server@131c9b8
  • Loading branch information
abernix authored Jan 29, 2020
1 parent bd2300a commit 9db3db8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
8 changes: 0 additions & 8 deletions federation-js/src/directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
},
},
});
Expand Down
2 changes: 1 addition & 1 deletion federation-js/src/service/printFederatedSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function printDescription(
| GraphQLUnionType,
indentation: string = '',
): string {
if (!def.description) {
if (def.description == null) {
return '';
}

Expand Down
1 change: 0 additions & 1 deletion federation-js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export const entitiesField: GraphQLFieldConfig<any, any> = {
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(AnyType))),
},
},
description: '',
resolve(_source, { representations }, context, info) {
return representations.map((reference: { __typename: string } & object) => {
const { __typename } = reference;
Expand Down

0 comments on commit 9db3db8

Please sign in to comment.