@@ -15,10 +15,10 @@ public async Task Schema_Without_TrueNullability()
15
15
. AddQueryType < Query > ( )
16
16
. ModifyOptions ( o => o . EnableTrueNullability = false )
17
17
. BuildSchemaAsync ( ) ;
18
-
18
+
19
19
schema . MatchSnapshot ( ) ;
20
20
}
21
-
21
+
22
22
[ Fact ]
23
23
public async Task Schema_With_TrueNullability ( )
24
24
{
@@ -28,10 +28,10 @@ public async Task Schema_With_TrueNullability()
28
28
. AddQueryType < Query > ( )
29
29
. ModifyOptions ( o => o . EnableTrueNullability = true )
30
30
. BuildSchemaAsync ( ) ;
31
-
31
+
32
32
schema . MatchSnapshot ( ) ;
33
33
}
34
-
34
+
35
35
[ Fact ]
36
36
public async Task Error_Query_With_TrueNullability_And_NullBubbling_Enabled_By_Default ( )
37
37
{
@@ -51,10 +51,10 @@ public async Task Error_Query_With_TrueNullability_And_NullBubbling_Enabled_By_D
51
51
}
52
52
}
53
53
""" ) ;
54
-
54
+
55
55
response . MatchSnapshot ( ) ;
56
56
}
57
-
57
+
58
58
[ Fact ]
59
59
public async Task Error_Query_With_TrueNullability_And_NullBubbling_Enabled ( )
60
60
{
@@ -74,10 +74,10 @@ query @nullBubbling {
74
74
}
75
75
}
76
76
""" ) ;
77
-
77
+
78
78
response . MatchSnapshot ( ) ;
79
79
}
80
-
80
+
81
81
[ Fact ]
82
82
public async Task Error_Query_With_TrueNullability_And_NullBubbling_Disabled ( )
83
83
{
@@ -97,10 +97,10 @@ query @nullBubbling(enable: false) {
97
97
}
98
98
}
99
99
""" ) ;
100
-
100
+
101
101
response . MatchSnapshot ( ) ;
102
102
}
103
-
103
+
104
104
[ Fact ]
105
105
public async Task Error_Query_With_TrueNullability_And_NullBubbling_Disabled_With_Variable ( )
106
106
{
@@ -124,24 +124,50 @@ public async Task Error_Query_With_TrueNullability_And_NullBubbling_Disabled_Wit
124
124
""" )
125
125
. SetVariableValue ( "enable" , false )
126
126
. Create ( ) ) ;
127
-
127
+
128
+ response . MatchSnapshot ( ) ;
129
+ }
130
+
131
+ [ Fact ]
132
+ public async Task Error_Query_With_NullBubbling_Disabled ( )
133
+ {
134
+ var request = QueryRequestBuilder . New ( )
135
+ . SetQuery ( """
136
+ query {
137
+ book {
138
+ name
139
+ author {
140
+ name
141
+ }
142
+ }
143
+ }
144
+ """ )
145
+ . TryAddGlobalState ( WellKnownContextData . DisableNullBubbling , true )
146
+ . Create ( ) ;
147
+
148
+ var response =
149
+ await new ServiceCollection ( )
150
+ . AddGraphQLServer ( )
151
+ . AddQueryType < Query > ( )
152
+ . ExecuteRequestAsync ( request ) ;
153
+
128
154
response . MatchSnapshot ( ) ;
129
155
}
130
-
156
+
131
157
public class Query
132
158
{
133
159
public Book ? GetBook ( ) => new ( ) ;
134
160
}
135
-
161
+
136
162
public class Book
137
163
{
138
164
public string Name => "Some book!" ;
139
165
140
166
public Author Author => new ( ) ;
141
167
}
142
-
168
+
143
169
public class Author
144
170
{
145
171
public string Name => throw new Exception ( ) ;
146
- }
147
- }
172
+ }
173
+ }
0 commit comments