@@ -12,7 +12,8 @@ import type {
12
12
GraphQLFieldConfigMap ,
13
13
GraphQLInputField ,
14
14
GraphQLNamedType ,
15
- GraphQLType } from './definition' ;
15
+ GraphQLType ,
16
+ } from './definition' ;
16
17
import {
17
18
GraphQLEnumType ,
18
19
GraphQLList ,
@@ -406,22 +407,21 @@ export const __Field: GraphQLObjectType = new GraphQLObjectType({
406
407
type : new GraphQLNonNull ( __Type ) ,
407
408
args : {
408
409
nullability : {
409
- type : __TypeNullability ,
410
- defaultValue : ' AUTO' ,
410
+ type : new GraphQLNonNull ( __TypeNullability ) ,
411
+ defaultValue : TypeNullability . AUTO ,
411
412
} ,
412
413
} ,
413
414
resolve : ( field , { nullability } , _context , info ) => {
414
415
if ( nullability === TypeNullability . FULL ) {
415
416
return field . type ;
416
- }
417
- const mode =
418
- nullability === TypeNullability . AUTO
419
- ? info . errorPropagation
420
- ? TypeNullability . TRADITIONAL
421
- : TypeNullability . SEMANTIC
422
- : nullability ;
423
- return convertOutputTypeToNullabilityMode ( field . type , mode ) ;
424
-
417
+ }
418
+ const mode =
419
+ nullability === TypeNullability . AUTO
420
+ ? info . errorPropagation
421
+ ? TypeNullability . TRADITIONAL
422
+ : TypeNullability . SEMANTIC
423
+ : nullability ;
424
+ return convertOutputTypeToNullabilityMode ( field . type , mode ) ;
425
425
} ,
426
426
} ,
427
427
isDeprecated : {
@@ -451,22 +451,19 @@ function convertOutputTypeToNullabilityMode(
451
451
return new GraphQLList (
452
452
convertOutputTypeToNullabilityMode ( type . ofType , mode ) ,
453
453
) ;
454
- }
455
- return type ;
456
-
457
- }
458
- if ( isNonNullType ( type ) || isSemanticNonNullType ( type ) ) {
459
- return new GraphQLSemanticNonNull (
460
- convertOutputTypeToNullabilityMode ( type . ofType , mode ) ,
461
- ) ;
462
- } else if ( isListType ( type ) ) {
463
- return new GraphQLList (
464
- convertOutputTypeToNullabilityMode ( type . ofType , mode ) ,
465
- ) ;
466
- }
467
- return type ;
468
-
469
-
454
+ }
455
+ return type ;
456
+ }
457
+ if ( isNonNullType ( type ) || isSemanticNonNullType ( type ) ) {
458
+ return new GraphQLSemanticNonNull (
459
+ convertOutputTypeToNullabilityMode ( type . ofType , mode ) ,
460
+ ) ;
461
+ } else if ( isListType ( type ) ) {
462
+ return new GraphQLList (
463
+ convertOutputTypeToNullabilityMode ( type . ofType , mode ) ,
464
+ ) ;
465
+ }
466
+ return type ;
470
467
}
471
468
472
469
export const __InputValue : GraphQLObjectType = new GraphQLObjectType ( {
@@ -649,6 +646,7 @@ export const introspectionTypes: ReadonlyArray<GraphQLNamedType> =
649
646
__Schema ,
650
647
__Directive ,
651
648
__DirectiveLocation ,
649
+ __TypeNullability ,
652
650
__Type ,
653
651
__Field ,
654
652
__InputValue ,
0 commit comments