Skip to content

Commit 7fdd84e

Browse files
authored
Make includeDeprecated non-null (#4354)
1 parent b0f467d commit 7fdd84e

File tree

3 files changed

+45
-25
lines changed

3 files changed

+45
-25
lines changed

Diff for: src/type/__tests__/introspection-test.ts

+35-15
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,13 @@ describe('Introspection', () => {
242242
{
243243
name: 'includeDeprecated',
244244
type: {
245-
kind: 'SCALAR',
246-
name: 'Boolean',
247-
ofType: null,
245+
kind: 'NON_NULL',
246+
name: null,
247+
ofType: {
248+
kind: 'SCALAR',
249+
name: 'Boolean',
250+
ofType: null,
251+
},
248252
},
249253
defaultValue: 'false',
250254
},
@@ -309,9 +313,13 @@ describe('Introspection', () => {
309313
{
310314
name: 'includeDeprecated',
311315
type: {
312-
kind: 'SCALAR',
313-
name: 'Boolean',
314-
ofType: null,
316+
kind: 'NON_NULL',
317+
name: null,
318+
ofType: {
319+
kind: 'SCALAR',
320+
name: 'Boolean',
321+
ofType: null,
322+
},
315323
},
316324
defaultValue: 'false',
317325
},
@@ -338,9 +346,13 @@ describe('Introspection', () => {
338346
{
339347
name: 'includeDeprecated',
340348
type: {
341-
kind: 'SCALAR',
342-
name: 'Boolean',
343-
ofType: null,
349+
kind: 'NON_NULL',
350+
name: null,
351+
ofType: {
352+
kind: 'SCALAR',
353+
name: 'Boolean',
354+
ofType: null,
355+
},
344356
},
345357
defaultValue: 'false',
346358
},
@@ -477,9 +489,13 @@ describe('Introspection', () => {
477489
{
478490
name: 'includeDeprecated',
479491
type: {
480-
kind: 'SCALAR',
481-
name: 'Boolean',
482-
ofType: null,
492+
kind: 'NON_NULL',
493+
name: null,
494+
ofType: {
495+
kind: 'SCALAR',
496+
name: 'Boolean',
497+
ofType: null,
498+
},
483499
},
484500
defaultValue: 'false',
485501
},
@@ -778,9 +794,13 @@ describe('Introspection', () => {
778794
{
779795
name: 'includeDeprecated',
780796
type: {
781-
kind: 'SCALAR',
782-
name: 'Boolean',
783-
ofType: null,
797+
kind: 'NON_NULL',
798+
name: null,
799+
ofType: {
800+
kind: 'SCALAR',
801+
name: 'Boolean',
802+
ofType: null,
803+
},
784804
},
785805
defaultValue: 'false',
786806
},

Diff for: src/type/introspection.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const __Directive: GraphQLObjectType = new GraphQLObjectType({
107107
),
108108
args: {
109109
includeDeprecated: {
110-
type: GraphQLBoolean,
110+
type: new GraphQLNonNull(GraphQLBoolean),
111111
default: { value: false },
112112
},
113113
},
@@ -266,7 +266,7 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({
266266
type: new GraphQLList(new GraphQLNonNull(__Field)),
267267
args: {
268268
includeDeprecated: {
269-
type: GraphQLBoolean,
269+
type: new GraphQLNonNull(GraphQLBoolean),
270270
default: { value: false },
271271
},
272272
},
@@ -299,7 +299,7 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({
299299
type: new GraphQLList(new GraphQLNonNull(__EnumValue)),
300300
args: {
301301
includeDeprecated: {
302-
type: GraphQLBoolean,
302+
type: new GraphQLNonNull(GraphQLBoolean),
303303
default: { value: false },
304304
},
305305
},
@@ -316,7 +316,7 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({
316316
type: new GraphQLList(new GraphQLNonNull(__InputValue)),
317317
args: {
318318
includeDeprecated: {
319-
type: GraphQLBoolean,
319+
type: new GraphQLNonNull(GraphQLBoolean),
320320
default: { value: false },
321321
},
322322
},
@@ -364,7 +364,7 @@ export const __Field: GraphQLObjectType = new GraphQLObjectType({
364364
),
365365
args: {
366366
includeDeprecated: {
367-
type: GraphQLBoolean,
367+
type: new GraphQLNonNull(GraphQLBoolean),
368368
default: { value: false },
369369
},
370370
},

Diff for: src/utilities/__tests__/printSchema-test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -855,11 +855,11 @@ describe('Type System Printer', () => {
855855
name: String
856856
description: String
857857
specifiedByURL: String
858-
fields(includeDeprecated: Boolean = false): [__Field!]
858+
fields(includeDeprecated: Boolean! = false): [__Field!]
859859
interfaces: [__Type!]
860860
possibleTypes: [__Type!]
861-
enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
862-
inputFields(includeDeprecated: Boolean = false): [__InputValue!]
861+
enumValues(includeDeprecated: Boolean! = false): [__EnumValue!]
862+
inputFields(includeDeprecated: Boolean! = false): [__InputValue!]
863863
ofType: __Type
864864
isOneOf: Boolean
865865
}
@@ -903,7 +903,7 @@ describe('Type System Printer', () => {
903903
type __Field {
904904
name: String!
905905
description: String
906-
args(includeDeprecated: Boolean = false): [__InputValue!]!
906+
args(includeDeprecated: Boolean! = false): [__InputValue!]!
907907
type: __Type!
908908
isDeprecated: Boolean!
909909
deprecationReason: String
@@ -945,7 +945,7 @@ describe('Type System Printer', () => {
945945
description: String
946946
isRepeatable: Boolean!
947947
locations: [__DirectiveLocation!]!
948-
args(includeDeprecated: Boolean = false): [__InputValue!]!
948+
args(includeDeprecated: Boolean! = false): [__InputValue!]!
949949
}
950950
951951
"""

0 commit comments

Comments
 (0)