Skip to content

Commit f006523

Browse files
authored
Ensured that includeDeprecated is non-nullable (#8779)
1 parent a60feed commit f006523

File tree

8 files changed

+53
-29
lines changed

8 files changed

+53
-29
lines changed

src/HotChocolate/Core/src/Types/Types/Introspection/schema.gql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ type __Type
1212
name: String
1313
description: String
1414
# OBJECT and INTERFACE only
15-
fields(includeDeprecated: Boolean = false): [__Field!]
15+
fields(includeDeprecated: Boolean! = false): [__Field!]
1616
# OBJECT only
1717
interfaces: [__Type!]
1818
# INTERFACE and UNION only
1919
possibleTypes: [__Type!]
2020
# ENUM only
21-
enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
21+
enumValues(includeDeprecated: Boolean! = false): [__EnumValue!]
2222
# INPUT_OBJECT only
2323
inputFields: [__InputValue!]
2424
# NON_NULL and LIST only

src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaValidationRules/DisallowedInaccessibleElementsRuleTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ type Product {
9292
type __Type @inaccessible {
9393
kind: __TypeKind!
9494
name: String
95-
fields(includeDeprecated: Boolean = false): [__Field!]
95+
fields(includeDeprecated: Boolean! = false): [__Field!]
9696
}
9797
"""
9898
],
@@ -107,7 +107,7 @@ type __Type @inaccessible {
107107
type __Type {
108108
kind: __TypeKind! @inaccessible
109109
name: String
110-
fields(includeDeprecated: Boolean = false): [__Field!]
110+
fields(includeDeprecated: Boolean! = false): [__Field!]
111111
}
112112
"""
113113
],
@@ -122,7 +122,7 @@ type __Type {
122122
type __Type {
123123
kind: __TypeKind!
124124
name: String
125-
fields(includeDeprecated: Boolean = false @inaccessible): [__Field!]
125+
fields(includeDeprecated: Boolean! = false @inaccessible): [__Field!]
126126
}
127127
"""
128128
],

src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__resources__/IntrospectionWithDefaultValues.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,13 @@
361361
"name": "includeDeprecated",
362362
"description": null,
363363
"type": {
364-
"kind": "SCALAR",
365-
"name": "Boolean",
366-
"ofType": null
364+
"kind": "NON_NULL",
365+
"name": null,
366+
"ofType": {
367+
"kind": "SCALAR",
368+
"name": "Boolean",
369+
"ofType": null
370+
}
367371
},
368372
"defaultValue": "false"
369373
}],
@@ -430,9 +434,13 @@
430434
"name": "includeDeprecated",
431435
"description": null,
432436
"type": {
433-
"kind": "SCALAR",
434-
"name": "Boolean",
435-
"ofType": null
437+
"kind": "NON_NULL",
438+
"name": null,
439+
"ofType": {
440+
"kind": "SCALAR",
441+
"name": "Boolean",
442+
"ofType": null
443+
}
436444
},
437445
"defaultValue": "false"
438446
}],

src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__resources__/IntrospectionWithNullDeprecationReason.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,13 @@
361361
"name": "includeDeprecated",
362362
"description": null,
363363
"type": {
364-
"kind": "SCALAR",
365-
"name": "Boolean",
366-
"ofType": null
364+
"kind": "NON_NULL",
365+
"name": null,
366+
"ofType": {
367+
"kind": "SCALAR",
368+
"name": "Boolean",
369+
"ofType": null
370+
}
367371
},
368372
"defaultValue": "false"
369373
}],
@@ -430,9 +434,13 @@
430434
"name": "includeDeprecated",
431435
"description": null,
432436
"type": {
433-
"kind": "SCALAR",
434-
"name": "Boolean",
435-
"ofType": null
437+
"kind": "NON_NULL",
438+
"name": null,
439+
"ofType": {
440+
"kind": "SCALAR",
441+
"name": "Boolean",
442+
"ofType": null
443+
}
436444
},
437445
"defaultValue": "false"
438446
}],

src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__resources__/StarWarsIntrospectionResult.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,13 @@
754754
"name": "includeDeprecated",
755755
"description": null,
756756
"type": {
757-
"kind": "SCALAR",
758-
"name": "Boolean",
759-
"ofType": null
757+
"kind": "NON_NULL",
758+
"name": null,
759+
"ofType": {
760+
"kind": "SCALAR",
761+
"name": "Boolean",
762+
"ofType": null
763+
}
760764
},
761765
"defaultValue": "false"
762766
}],
@@ -823,9 +827,13 @@
823827
"name": "includeDeprecated",
824828
"description": null,
825829
"type": {
826-
"kind": "SCALAR",
827-
"name": "Boolean",
828-
"ofType": null
830+
"kind": "NON_NULL",
831+
"name": null,
832+
"ofType": {
833+
"kind": "SCALAR",
834+
"name": "Boolean",
835+
"ofType": null
836+
}
829837
},
830838
"defaultValue": "false"
831839
}],

src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionFormatterTests.DeserializeIntrospectionWithIntDefaultValues.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ type __Type {
5353
kind: __TypeKind!
5454
name: String
5555
description: String
56-
fields(includeDeprecated: Boolean = false): [__Field!]
56+
fields(includeDeprecated: Boolean! = false): [__Field!]
5757
interfaces: [__Type!]
5858
possibleTypes: [__Type!]
59-
enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
59+
enumValues(includeDeprecated: Boolean! = false): [__EnumValue!]
6060
inputFields: [__InputValue!]
6161
ofType: __Type
6262
}

src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionFormatterTests.DeserializeIntrospectionWithNullDeprecationReason.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ type __Type {
5353
kind: __TypeKind!
5454
name: String
5555
description: String
56-
fields(includeDeprecated: Boolean = false): [__Field!]
56+
fields(includeDeprecated: Boolean! = false): [__Field!]
5757
interfaces: [__Type!]
5858
possibleTypes: [__Type!]
59-
enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
59+
enumValues(includeDeprecated: Boolean! = false): [__EnumValue!]
6060
inputFields: [__InputValue!]
6161
ofType: __Type
6262
}

src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionFormatterTests.DeserializeStarWarsIntrospectionResult.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ type __Type {
130130
kind: __TypeKind!
131131
name: String
132132
description: String
133-
fields(includeDeprecated: Boolean = false): [__Field!]
133+
fields(includeDeprecated: Boolean! = false): [__Field!]
134134
interfaces: [__Type!]
135135
possibleTypes: [__Type!]
136-
enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
136+
enumValues(includeDeprecated: Boolean! = false): [__EnumValue!]
137137
inputFields: [__InputValue!]
138138
ofType: __Type
139139
}

0 commit comments

Comments
 (0)