Skip to content

Commit a0f1526

Browse files
committed
Make includeDeprecated non nullable. (#8124)
1 parent 7376a43 commit a0f1526

File tree

10 files changed

+321
-131
lines changed

10 files changed

+321
-131
lines changed

src/HotChocolate/Core/src/Types/Types/Introspection/__Directive.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ protected override ObjectTypeDefinition CreateDefinition(ITypeDiscoveryContext c
1919
var stringType = Create(ScalarNames.String);
2020
var nonNullStringType = Parse($"{ScalarNames.String}!");
2121
var nonNullBooleanType = Parse($"{ScalarNames.Boolean}!");
22-
var booleanType = Parse($"{ScalarNames.Boolean}");
2322
var argumentListType = Parse($"[{nameof(__InputValue)}!]!");
2423
var locationListType = Parse($"[{nameof(__DirectiveLocation)}!]!");
2524

@@ -37,7 +36,7 @@ protected override ObjectTypeDefinition CreateDefinition(ITypeDiscoveryContext c
3736
{
3837
Arguments =
3938
{
40-
new(Names.IncludeDeprecated, type: booleanType)
39+
new(Names.IncludeDeprecated, type: nonNullBooleanType)
4140
{
4241
DefaultValue = BooleanValueNode.False,
4342
RuntimeDefaultValue = false,

src/HotChocolate/Core/src/Types/Types/Introspection/__Field.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ protected override ObjectTypeDefinition CreateDefinition(ITypeDiscoveryContext c
2020
var nonNullStringType = Parse($"{ScalarNames.String}!");
2121
var nonNullTypeType = Parse($"{nameof(__Type)}!");
2222
var nonNullBooleanType = Parse($"{ScalarNames.Boolean}!");
23-
var booleanType = Parse($"{ScalarNames.Boolean}");
2423
var argumentListType = Parse($"[{nameof(__InputValue)}!]!");
2524
var directiveListType = Parse($"[{nameof(__AppliedDirective)}!]!");
2625

@@ -37,7 +36,7 @@ protected override ObjectTypeDefinition CreateDefinition(ITypeDiscoveryContext c
3736
{
3837
Arguments =
3938
{
40-
new(Names.IncludeDeprecated, type: booleanType)
39+
new(Names.IncludeDeprecated, type: nonNullBooleanType)
4140
{
4241
DefaultValue = BooleanValueNode.False,
4342
RuntimeDefaultValue = false,

src/HotChocolate/Core/src/Types/Types/Introspection/__Type.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ protected override ObjectTypeDefinition CreateDefinition(ITypeDiscoveryContext c
1818
{
1919
var stringType = Create(ScalarNames.String);
2020
var booleanType = Create(ScalarNames.Boolean);
21+
var nonNullBooleanType = Parse($"{ScalarNames.Boolean}!");
2122
var kindType = Parse($"{nameof(__TypeKind)}!");
2223
var typeType = Create(nameof(__Type));
2324
var fieldListType = Parse($"[{nameof(__Field)}!]");
@@ -40,7 +41,7 @@ protected override ObjectTypeDefinition CreateDefinition(ITypeDiscoveryContext c
4041
{
4142
Arguments =
4243
{
43-
new(Names.IncludeDeprecated, type: booleanType)
44+
new(Names.IncludeDeprecated, type: nonNullBooleanType)
4445
{
4546
DefaultValue = BooleanValueNode.False,
4647
RuntimeDefaultValue = false,
@@ -53,10 +54,8 @@ protected override ObjectTypeDefinition CreateDefinition(ITypeDiscoveryContext c
5354
{
5455
Arguments =
5556
{
56-
new()
57+
new(Names.IncludeDeprecated, type: nonNullBooleanType)
5758
{
58-
Name = Names.IncludeDeprecated,
59-
Type = booleanType,
6059
DefaultValue = BooleanValueNode.False,
6160
RuntimeDefaultValue = false,
6261
},
@@ -68,10 +67,8 @@ protected override ObjectTypeDefinition CreateDefinition(ITypeDiscoveryContext c
6867
{
6968
Arguments =
7069
{
71-
new()
70+
new(Names.IncludeDeprecated, type: nonNullBooleanType)
7271
{
73-
Name = Names.IncludeDeprecated,
74-
Type = booleanType,
7572
DefaultValue = BooleanValueNode.False,
7673
RuntimeDefaultValue = false,
7774
},

src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Ensure_Benchmark_Query_LargeQuery.snap

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4986,9 +4986,13 @@
49864986
"name": "includeDeprecated",
49874987
"description": null,
49884988
"type": {
4989-
"kind": "SCALAR",
4990-
"name": "Boolean",
4991-
"ofType": null
4989+
"kind": "NON_NULL",
4990+
"name": null,
4991+
"ofType": {
4992+
"kind": "SCALAR",
4993+
"name": "Boolean",
4994+
"ofType": null
4995+
}
49924996
},
49934997
"defaultValue": "false"
49944998
}
@@ -5315,9 +5319,13 @@
53155319
"name": "includeDeprecated",
53165320
"description": null,
53175321
"type": {
5318-
"kind": "SCALAR",
5319-
"name": "Boolean",
5320-
"ofType": null
5322+
"kind": "NON_NULL",
5323+
"name": null,
5324+
"ofType": {
5325+
"kind": "SCALAR",
5326+
"name": "Boolean",
5327+
"ofType": null
5328+
}
53215329
},
53225330
"defaultValue": "false"
53235331
}
@@ -5648,9 +5656,13 @@
56485656
"name": "includeDeprecated",
56495657
"description": null,
56505658
"type": {
5651-
"kind": "SCALAR",
5652-
"name": "Boolean",
5653-
"ofType": null
5659+
"kind": "NON_NULL",
5660+
"name": null,
5661+
"ofType": {
5662+
"kind": "SCALAR",
5663+
"name": "Boolean",
5664+
"ofType": null
5665+
}
56545666
},
56555667
"defaultValue": "false"
56565668
}
@@ -5719,9 +5731,13 @@
57195731
"name": "includeDeprecated",
57205732
"description": null,
57215733
"type": {
5722-
"kind": "SCALAR",
5723-
"name": "Boolean",
5724-
"ofType": null
5734+
"kind": "NON_NULL",
5735+
"name": null,
5736+
"ofType": {
5737+
"kind": "SCALAR",
5738+
"name": "Boolean",
5739+
"ofType": null
5740+
}
57255741
},
57265742
"defaultValue": "false"
57275743
}
@@ -5750,9 +5766,13 @@
57505766
"name": "includeDeprecated",
57515767
"description": null,
57525768
"type": {
5753-
"kind": "SCALAR",
5754-
"name": "Boolean",
5755-
"ofType": null
5769+
"kind": "NON_NULL",
5770+
"name": null,
5771+
"ofType": {
5772+
"kind": "SCALAR",
5773+
"name": "Boolean",
5774+
"ofType": null
5775+
}
57565776
},
57575777
"defaultValue": "false"
57585778
}

src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.DefaultValueIsInputObject.snap

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@
7171
"name": "includeDeprecated",
7272
"description": null,
7373
"type": {
74-
"kind": "SCALAR",
75-
"name": "Boolean",
76-
"ofType": null
74+
"kind": "NON_NULL",
75+
"name": null,
76+
"ofType": {
77+
"kind": "SCALAR",
78+
"name": "Boolean",
79+
"ofType": null
80+
}
7781
},
7882
"defaultValue": "false",
7983
"isDeprecated": false,
@@ -402,9 +406,13 @@
402406
"name": "includeDeprecated",
403407
"description": null,
404408
"type": {
405-
"kind": "SCALAR",
406-
"name": "Boolean",
407-
"ofType": null
409+
"kind": "NON_NULL",
410+
"name": null,
411+
"ofType": {
412+
"kind": "SCALAR",
413+
"name": "Boolean",
414+
"ofType": null
415+
}
408416
},
409417
"defaultValue": "false",
410418
"isDeprecated": false,
@@ -737,9 +745,13 @@
737745
"name": "includeDeprecated",
738746
"description": null,
739747
"type": {
740-
"kind": "SCALAR",
741-
"name": "Boolean",
742-
"ofType": null
748+
"kind": "NON_NULL",
749+
"name": null,
750+
"ofType": {
751+
"kind": "SCALAR",
752+
"name": "Boolean",
753+
"ofType": null
754+
}
743755
},
744756
"defaultValue": "false",
745757
"isDeprecated": false,
@@ -810,9 +822,13 @@
810822
"name": "includeDeprecated",
811823
"description": null,
812824
"type": {
813-
"kind": "SCALAR",
814-
"name": "Boolean",
815-
"ofType": null
825+
"kind": "NON_NULL",
826+
"name": null,
827+
"ofType": {
828+
"kind": "SCALAR",
829+
"name": "Boolean",
830+
"ofType": null
831+
}
816832
},
817833
"defaultValue": "false",
818834
"isDeprecated": false,
@@ -843,9 +859,13 @@
843859
"name": "includeDeprecated",
844860
"description": null,
845861
"type": {
846-
"kind": "SCALAR",
847-
"name": "Boolean",
848-
"ofType": null
862+
"kind": "NON_NULL",
863+
"name": null,
864+
"ofType": {
865+
"kind": "SCALAR",
866+
"name": "Boolean",
867+
"ofType": null
868+
}
849869
},
850870
"defaultValue": "false",
851871
"isDeprecated": false,

src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.ExecuteGraphiQLIntrospectionQuery.snap

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@
7171
"name": "includeDeprecated",
7272
"description": null,
7373
"type": {
74-
"kind": "SCALAR",
75-
"name": "Boolean",
76-
"ofType": null
74+
"kind": "NON_NULL",
75+
"name": null,
76+
"ofType": {
77+
"kind": "SCALAR",
78+
"name": "Boolean",
79+
"ofType": null
80+
}
7781
},
7882
"defaultValue": "false",
7983
"isDeprecated": false,
@@ -402,9 +406,13 @@
402406
"name": "includeDeprecated",
403407
"description": null,
404408
"type": {
405-
"kind": "SCALAR",
406-
"name": "Boolean",
407-
"ofType": null
409+
"kind": "NON_NULL",
410+
"name": null,
411+
"ofType": {
412+
"kind": "SCALAR",
413+
"name": "Boolean",
414+
"ofType": null
415+
}
408416
},
409417
"defaultValue": "false",
410418
"isDeprecated": false,
@@ -737,9 +745,13 @@
737745
"name": "includeDeprecated",
738746
"description": null,
739747
"type": {
740-
"kind": "SCALAR",
741-
"name": "Boolean",
742-
"ofType": null
748+
"kind": "NON_NULL",
749+
"name": null,
750+
"ofType": {
751+
"kind": "SCALAR",
752+
"name": "Boolean",
753+
"ofType": null
754+
}
743755
},
744756
"defaultValue": "false",
745757
"isDeprecated": false,
@@ -810,9 +822,13 @@
810822
"name": "includeDeprecated",
811823
"description": null,
812824
"type": {
813-
"kind": "SCALAR",
814-
"name": "Boolean",
815-
"ofType": null
825+
"kind": "NON_NULL",
826+
"name": null,
827+
"ofType": {
828+
"kind": "SCALAR",
829+
"name": "Boolean",
830+
"ofType": null
831+
}
816832
},
817833
"defaultValue": "false",
818834
"isDeprecated": false,
@@ -843,9 +859,13 @@
843859
"name": "includeDeprecated",
844860
"description": null,
845861
"type": {
846-
"kind": "SCALAR",
847-
"name": "Boolean",
848-
"ofType": null
862+
"kind": "NON_NULL",
863+
"name": null,
864+
"ofType": {
865+
"kind": "SCALAR",
866+
"name": "Boolean",
867+
"ofType": null
868+
}
849869
},
850870
"defaultValue": "false",
851871
"isDeprecated": false,

0 commit comments

Comments
 (0)