diff --git a/src/type/__tests__/introspection-test.ts b/src/type/__tests__/introspection-test.ts index 9cdfe70697..d5157b9750 100644 --- a/src/type/__tests__/introspection-test.ts +++ b/src/type/__tests__/introspection-test.ts @@ -242,9 +242,13 @@ describe('Introspection', () => { { name: 'includeDeprecated', type: { - kind: 'SCALAR', - name: 'Boolean', - ofType: null, + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, }, defaultValue: 'false', }, @@ -309,9 +313,13 @@ describe('Introspection', () => { { name: 'includeDeprecated', type: { - kind: 'SCALAR', - name: 'Boolean', - ofType: null, + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, }, defaultValue: 'false', }, @@ -338,9 +346,13 @@ describe('Introspection', () => { { name: 'includeDeprecated', type: { - kind: 'SCALAR', - name: 'Boolean', - ofType: null, + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, }, defaultValue: 'false', }, @@ -477,9 +489,13 @@ describe('Introspection', () => { { name: 'includeDeprecated', type: { - kind: 'SCALAR', - name: 'Boolean', - ofType: null, + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, }, defaultValue: 'false', }, @@ -778,9 +794,13 @@ describe('Introspection', () => { { name: 'includeDeprecated', type: { - kind: 'SCALAR', - name: 'Boolean', - ofType: null, + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, }, defaultValue: 'false', }, diff --git a/src/type/introspection.ts b/src/type/introspection.ts index fc214bed3d..e9181f53ca 100644 --- a/src/type/introspection.ts +++ b/src/type/introspection.ts @@ -107,7 +107,7 @@ export const __Directive: GraphQLObjectType = new GraphQLObjectType({ ), args: { includeDeprecated: { - type: GraphQLBoolean, + type: new GraphQLNonNull(GraphQLBoolean), default: { value: false }, }, }, @@ -266,7 +266,7 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({ type: new GraphQLList(new GraphQLNonNull(__Field)), args: { includeDeprecated: { - type: GraphQLBoolean, + type: new GraphQLNonNull(GraphQLBoolean), default: { value: false }, }, }, @@ -299,7 +299,7 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({ type: new GraphQLList(new GraphQLNonNull(__EnumValue)), args: { includeDeprecated: { - type: GraphQLBoolean, + type: new GraphQLNonNull(GraphQLBoolean), default: { value: false }, }, }, @@ -316,7 +316,7 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({ type: new GraphQLList(new GraphQLNonNull(__InputValue)), args: { includeDeprecated: { - type: GraphQLBoolean, + type: new GraphQLNonNull(GraphQLBoolean), default: { value: false }, }, }, @@ -364,7 +364,7 @@ export const __Field: GraphQLObjectType = new GraphQLObjectType({ ), args: { includeDeprecated: { - type: GraphQLBoolean, + type: new GraphQLNonNull(GraphQLBoolean), default: { value: false }, }, }, diff --git a/src/utilities/__tests__/printSchema-test.ts b/src/utilities/__tests__/printSchema-test.ts index 3c28907f40..b03e01026e 100644 --- a/src/utilities/__tests__/printSchema-test.ts +++ b/src/utilities/__tests__/printSchema-test.ts @@ -855,11 +855,11 @@ describe('Type System Printer', () => { name: String description: String specifiedByURL: String - fields(includeDeprecated: Boolean = false): [__Field!] + fields(includeDeprecated: Boolean! = false): [__Field!] interfaces: [__Type!] possibleTypes: [__Type!] - enumValues(includeDeprecated: Boolean = false): [__EnumValue!] - inputFields(includeDeprecated: Boolean = false): [__InputValue!] + enumValues(includeDeprecated: Boolean! = false): [__EnumValue!] + inputFields(includeDeprecated: Boolean! = false): [__InputValue!] ofType: __Type isOneOf: Boolean } @@ -903,7 +903,7 @@ describe('Type System Printer', () => { type __Field { name: String! description: String - args(includeDeprecated: Boolean = false): [__InputValue!]! + args(includeDeprecated: Boolean! = false): [__InputValue!]! type: __Type! isDeprecated: Boolean! deprecationReason: String @@ -945,7 +945,7 @@ describe('Type System Printer', () => { description: String isRepeatable: Boolean! locations: [__DirectiveLocation!]! - args(includeDeprecated: Boolean = false): [__InputValue!]! + args(includeDeprecated: Boolean! = false): [__InputValue!]! } """