@@ -52,10 +52,10 @@ import {
52
52
import type { GraphQLSchema } from '../type/schema' ;
53
53
import { assertValidSchema } from '../type/validate' ;
54
54
55
+ import type { FieldDetails } from './collectFields' ;
55
56
import {
56
57
collectFields ,
57
58
collectSubfields as _collectSubfields ,
58
- FieldDetails ,
59
59
} from './collectFields' ;
60
60
import { getArgumentValues , getVariableValues } from './values' ;
61
61
@@ -523,7 +523,7 @@ function executeField(
523
523
fieldEntries [ 0 ] . node ,
524
524
fieldDef . args ,
525
525
exeContext . variableValues ,
526
- fieldEntries [ 0 ] . fragmentVariableValues
526
+ fieldEntries [ 0 ] . fragmentVariableValues ,
527
527
) ;
528
528
529
529
// The resolve function's optional third argument is a context value that
@@ -536,7 +536,14 @@ function executeField(
536
536
let completed ;
537
537
if ( isPromise ( result ) ) {
538
538
completed = result . then ( ( resolved ) =>
539
- completeValue ( exeContext , returnType , fieldEntries , info , path , resolved ) ,
539
+ completeValue (
540
+ exeContext ,
541
+ returnType ,
542
+ fieldEntries ,
543
+ info ,
544
+ path ,
545
+ resolved ,
546
+ ) ,
540
547
) ;
541
548
} else {
542
549
completed = completeValue (
@@ -553,13 +560,21 @@ function executeField(
553
560
// Note: we don't rely on a `catch` method, but we do expect "thenable"
554
561
// to take a second callback for the error case.
555
562
return completed . then ( undefined , ( rawError ) => {
556
- const error = locatedError ( rawError , fieldEntries . map ( entry => entry . node ) , pathToArray ( path ) ) ;
563
+ const error = locatedError (
564
+ rawError ,
565
+ fieldEntries . map ( ( entry ) => entry . node ) ,
566
+ pathToArray ( path ) ,
567
+ ) ;
557
568
return handleFieldError ( error , returnType , exeContext ) ;
558
569
} ) ;
559
570
}
560
571
return completed ;
561
572
} catch ( rawError ) {
562
- const error = locatedError ( rawError , fieldEntries . map ( entry => entry . node ) , pathToArray ( path ) ) ;
573
+ const error = locatedError (
574
+ rawError ,
575
+ fieldEntries . map ( ( entry ) => entry . node ) ,
576
+ pathToArray ( path ) ,
577
+ ) ;
563
578
return handleFieldError ( error , returnType , exeContext ) ;
564
579
}
565
580
}
@@ -578,7 +593,7 @@ export function buildResolveInfo(
578
593
// information about the current execution state.
579
594
return {
580
595
fieldName : fieldDef . name ,
581
- fieldNodes : fieldEntries . map ( entry => entry . node ) ,
596
+ fieldNodes : fieldEntries . map ( ( entry ) => entry . node ) ,
582
597
returnType : fieldDef . type ,
583
598
parentType,
584
599
path,
@@ -772,15 +787,19 @@ function completeListValue(
772
787
return completedItem . then ( undefined , ( rawError ) => {
773
788
const error = locatedError (
774
789
rawError ,
775
- fieldEntries . map ( entry => entry . node ) ,
790
+ fieldEntries . map ( ( entry ) => entry . node ) ,
776
791
pathToArray ( itemPath ) ,
777
792
) ;
778
793
return handleFieldError ( error , itemType , exeContext ) ;
779
794
} ) ;
780
795
}
781
796
return completedItem ;
782
797
} catch ( rawError ) {
783
- const error = locatedError ( rawError , fieldEntries . map ( entry => entry . node ) , pathToArray ( itemPath ) ) ;
798
+ const error = locatedError (
799
+ rawError ,
800
+ fieldEntries . map ( ( entry ) => entry . node ) ,
801
+ pathToArray ( itemPath ) ,
802
+ ) ;
784
803
return handleFieldError ( error , itemType , exeContext ) ;
785
804
}
786
805
} ) ;
@@ -822,7 +841,7 @@ function completeAbstractValue(
822
841
const contextValue = exeContext . contextValue ;
823
842
const runtimeType = resolveTypeFn ( result , contextValue , info , returnType ) ;
824
843
825
- const fieldNodes = fieldEntries . map ( entry => entry . node )
844
+ const fieldNodes = fieldEntries . map ( ( entry ) => entry . node ) ;
826
845
if ( isPromise ( runtimeType ) ) {
827
846
return runtimeType . then ( ( resolvedRuntimeType ) =>
828
847
completeObjectValue (
@@ -938,7 +957,11 @@ function completeObjectValue(
938
957
if ( isPromise ( isTypeOf ) ) {
939
958
return isTypeOf . then ( ( resolvedIsTypeOf ) => {
940
959
if ( ! resolvedIsTypeOf ) {
941
- throw invalidReturnTypeError ( returnType , result , fieldEntries . map ( entry => entry . node ) ) ;
960
+ throw invalidReturnTypeError (
961
+ returnType ,
962
+ result ,
963
+ fieldEntries . map ( ( entry ) => entry . node ) ,
964
+ ) ;
942
965
}
943
966
return executeFields (
944
967
exeContext ,
@@ -951,7 +974,11 @@ function completeObjectValue(
951
974
}
952
975
953
976
if ( ! isTypeOf ) {
954
- throw invalidReturnTypeError ( returnType , result , fieldEntries . map ( entry => entry . node ) ) ;
977
+ throw invalidReturnTypeError (
978
+ returnType ,
979
+ result ,
980
+ fieldEntries . map ( ( entry ) => entry . node ) ,
981
+ ) ;
955
982
}
956
983
}
957
984
0 commit comments