Skip to content

Commit

Permalink
Always invoke GraphQLNonNull as a constructor
Browse files Browse the repository at this point in the history
This was always the recommended style, but now that `GraphQLNonNull` and `GraphQLList` have been converted to proper classes in graphql/graphql-js#2906, calling them as functions no longer works.
  • Loading branch information
martijnwalraven committed Mar 25, 2021
1 parent 0b133e5 commit 1b2af2d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion federation-js/src/coreSpec.ts
Expand Up @@ -10,7 +10,7 @@ export const CoreDirective = new GraphQLDirective({
locations: [DirectiveLocation.SCHEMA],
args: {
feature: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
isRepeatable: true,
Expand Down
18 changes: 9 additions & 9 deletions federation-js/src/csdlDirectives.ts
Expand Up @@ -11,7 +11,7 @@ export const ComposedGraphDirective = new GraphQLDirective({
locations: [DirectiveLocation.SCHEMA],
args: {
version: {
type: GraphQLNonNull(GraphQLInt),
type: new GraphQLNonNull(GraphQLInt),
},
},
});
Expand All @@ -21,10 +21,10 @@ export const GraphDirective = new GraphQLDirective({
locations: [DirectiveLocation.SCHEMA],
args: {
name: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
url: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
isRepeatable: true,
Expand All @@ -35,7 +35,7 @@ export const OwnerDirective = new GraphQLDirective({
locations: [DirectiveLocation.OBJECT],
args: {
graph: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
});
Expand All @@ -45,10 +45,10 @@ export const KeyDirective = new GraphQLDirective({
locations: [DirectiveLocation.OBJECT],
args: {
fields: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
graph: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
isRepeatable: true,
Expand All @@ -59,7 +59,7 @@ export const ResolveDirective = new GraphQLDirective({
locations: [DirectiveLocation.FIELD_DEFINITION],
args: {
graph: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
});
Expand All @@ -69,7 +69,7 @@ export const ProvidesDirective = new GraphQLDirective({
locations: [DirectiveLocation.FIELD_DEFINITION],
args: {
fields: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
});
Expand All @@ -79,7 +79,7 @@ export const RequiresDirective = new GraphQLDirective({
locations: [DirectiveLocation.FIELD_DEFINITION],
args: {
fields: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
});
Expand Down
6 changes: 3 additions & 3 deletions federation-js/src/directives.ts
Expand Up @@ -26,7 +26,7 @@ export const KeyDirective = new GraphQLDirective({
locations: [DirectiveLocation.OBJECT, DirectiveLocation.INTERFACE],
args: {
fields: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
});
Expand All @@ -46,7 +46,7 @@ export const RequiresDirective = new GraphQLDirective({
locations: [DirectiveLocation.FIELD_DEFINITION],
args: {
fields: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
});
Expand All @@ -56,7 +56,7 @@ export const ProvidesDirective = new GraphQLDirective({
locations: [DirectiveLocation.FIELD_DEFINITION],
args: {
fields: {
type: GraphQLNonNull(GraphQLString),
type: new GraphQLNonNull(GraphQLString),
},
},
});
Expand Down

0 comments on commit 1b2af2d

Please sign in to comment.