@@ -51,6 +51,7 @@ public class GraphQLEngine
51
51
private IErrorTransformation _errorTransformation = new DefaultErrorTransformation ( ) ;
52
52
53
53
private bool _includeFieldDescriptions ;
54
+ private bool _throwUnhandledExceptions ;
54
55
55
56
private bool _includeFieldDeprecationReasons ;
56
57
@@ -208,6 +209,12 @@ public GraphQLEngine PrintFieldDescriptions(bool include = true)
208
209
return this ;
209
210
}
210
211
212
+ public GraphQLEngine ThrowUnhandledExceptions ( bool throwUnhandledExceptions = true )
213
+ {
214
+ _throwUnhandledExceptions = throwUnhandledExceptions ;
215
+ return this ;
216
+ }
217
+
211
218
public GraphQLEngine PrintFieldDeprecationReasons ( bool include = true )
212
219
{
213
220
_includeFieldDeprecationReasons = include ;
@@ -297,12 +304,13 @@ internal async Task<ExecutionResult> ExecuteAsync(
297
304
EnableMetrics = enableProfiling ,
298
305
UserContext = new Dictionary < string , object > ( )
299
306
{
300
- { typeof ( IUserContext ) . FullName ?? nameof ( IUserContext ) , userContext } ,
301
- { typeof ( IDependencyInjector ) . FullName ?? nameof ( IDependencyInjector ) , dependencyInjector } ,
307
+ { typeof ( IUserContext ) . FullName ?? nameof ( IUserContext ) , userContext } ,
308
+ { typeof ( IDependencyInjector ) . FullName ?? nameof ( IDependencyInjector ) , dependencyInjector } ,
302
309
} ,
303
310
ValidationRules = validationRules . Any ( ) ? validationRules : null ,
304
311
ComplexityConfiguration = complexityConfiguration ,
305
312
CancellationToken = cancellationToken ,
313
+ ThrowOnUnhandledException = _throwUnhandledExceptions ,
306
314
} ;
307
315
308
316
if ( listeners != null )
0 commit comments