@@ -224,7 +224,7 @@ type executeFieldsParams struct {
224
224
ParentType * Object
225
225
Source interface {}
226
226
Fields map [string ][]* ast.Field
227
- Path * responsePath
227
+ Path * ResponsePath
228
228
}
229
229
230
230
// Implements the "Evaluating selection sets" section of the spec for "write" mode.
@@ -559,7 +559,7 @@ type resolveFieldResultState struct {
559
559
hasNoFieldDefs bool
560
560
}
561
561
562
- func handleFieldError (r interface {}, fieldNodes []ast.Node , path * responsePath , returnType Output , eCtx * executionContext ) {
562
+ func handleFieldError (r interface {}, fieldNodes []ast.Node , path * ResponsePath , returnType Output , eCtx * executionContext ) {
563
563
err := NewLocatedErrorWithPath (r , fieldNodes , path .AsArray ())
564
564
// send panic upstream
565
565
if _ , ok := returnType .(* NonNull ); ok {
@@ -572,7 +572,7 @@ func handleFieldError(r interface{}, fieldNodes []ast.Node, path *responsePath,
572
572
// figures out the value that the field returns by calling its resolve function,
573
573
// then calls completeValue to complete promises, serialize scalars, or execute
574
574
// the sub-selection-set for objects.
575
- func resolveField (eCtx * executionContext , parentType * Object , source interface {}, fieldASTs []* ast.Field , path * responsePath ) (result interface {}, resultState resolveFieldResultState ) {
575
+ func resolveField (eCtx * executionContext , parentType * Object , source interface {}, fieldASTs []* ast.Field , path * ResponsePath ) (result interface {}, resultState resolveFieldResultState ) {
576
576
// catch panic from resolveFn
577
577
var returnType Output
578
578
defer func () (interface {}, resolveFieldResultState ) {
@@ -608,6 +608,7 @@ func resolveField(eCtx *executionContext, parentType *Object, source interface{}
608
608
info := ResolveInfo {
609
609
FieldName : fieldName ,
610
610
FieldASTs : fieldASTs ,
611
+ Path : path ,
611
612
ReturnType : returnType ,
612
613
ParentType : parentType ,
613
614
Schema : eCtx .Schema ,
@@ -634,7 +635,7 @@ func resolveField(eCtx *executionContext, parentType *Object, source interface{}
634
635
return completed , resultState
635
636
}
636
637
637
- func completeValueCatchingError (eCtx * executionContext , returnType Type , fieldASTs []* ast.Field , info ResolveInfo , path * responsePath , result interface {}) (completed interface {}) {
638
+ func completeValueCatchingError (eCtx * executionContext , returnType Type , fieldASTs []* ast.Field , info ResolveInfo , path * ResponsePath , result interface {}) (completed interface {}) {
638
639
// catch panic
639
640
defer func () interface {} {
640
641
if r := recover (); r != nil {
@@ -652,7 +653,7 @@ func completeValueCatchingError(eCtx *executionContext, returnType Type, fieldAS
652
653
return completed
653
654
}
654
655
655
- func completeValue (eCtx * executionContext , returnType Type , fieldASTs []* ast.Field , info ResolveInfo , path * responsePath , result interface {}) interface {} {
656
+ func completeValue (eCtx * executionContext , returnType Type , fieldASTs []* ast.Field , info ResolveInfo , path * ResponsePath , result interface {}) interface {} {
656
657
657
658
resultVal := reflect .ValueOf (result )
658
659
if resultVal .IsValid () && resultVal .Kind () == reflect .Func {
@@ -719,7 +720,7 @@ func completeValue(eCtx *executionContext, returnType Type, fieldASTs []*ast.Fie
719
720
return nil
720
721
}
721
722
722
- func completeThunkValueCatchingError (eCtx * executionContext , returnType Type , fieldASTs []* ast.Field , info ResolveInfo , path * responsePath , result interface {}) (completed interface {}) {
723
+ func completeThunkValueCatchingError (eCtx * executionContext , returnType Type , fieldASTs []* ast.Field , info ResolveInfo , path * ResponsePath , result interface {}) (completed interface {}) {
723
724
724
725
// catch any panic invoked from the propertyFn (thunk)
725
726
defer func () {
@@ -751,7 +752,7 @@ func completeThunkValueCatchingError(eCtx *executionContext, returnType Type, fi
751
752
752
753
// completeAbstractValue completes value of an Abstract type (Union / Interface) by determining the runtime type
753
754
// of that value, then completing based on that type.
754
- func completeAbstractValue (eCtx * executionContext , returnType Abstract , fieldASTs []* ast.Field , info ResolveInfo , path * responsePath , result interface {}) interface {} {
755
+ func completeAbstractValue (eCtx * executionContext , returnType Abstract , fieldASTs []* ast.Field , info ResolveInfo , path * ResponsePath , result interface {}) interface {} {
755
756
756
757
var runtimeType * Object
757
758
@@ -788,7 +789,7 @@ func completeAbstractValue(eCtx *executionContext, returnType Abstract, fieldAST
788
789
}
789
790
790
791
// completeObjectValue complete an Object value by executing all sub-selections.
791
- func completeObjectValue (eCtx * executionContext , returnType * Object , fieldASTs []* ast.Field , info ResolveInfo , path * responsePath , result interface {}) interface {} {
792
+ func completeObjectValue (eCtx * executionContext , returnType * Object , fieldASTs []* ast.Field , info ResolveInfo , path * ResponsePath , result interface {}) interface {} {
792
793
793
794
// If there is an isTypeOf predicate function, call it with the
794
795
// current result. If isTypeOf returns false, then raise an error rather
@@ -845,7 +846,7 @@ func completeLeafValue(returnType Leaf, result interface{}) interface{} {
845
846
}
846
847
847
848
// completeListValue complete a list value by completing each item in the list with the inner type
848
- func completeListValue (eCtx * executionContext , returnType * List , fieldASTs []* ast.Field , info ResolveInfo , path * responsePath , result interface {}) interface {} {
849
+ func completeListValue (eCtx * executionContext , returnType * List , fieldASTs []* ast.Field , info ResolveInfo , path * ResponsePath , result interface {}) interface {} {
849
850
resultVal := reflect .ValueOf (result )
850
851
if resultVal .Kind () == reflect .Ptr {
851
852
resultVal = resultVal .Elem ()
0 commit comments