You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Abstract type resolution for "Pet" for field "Query.pet" failed. Encountered abstract type "Pet" must resolve to an Object or Interface type at runtime. Either the "Pet" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.',
274
+
'Abstract type "Pet" must resolve to an Object type or an intermediate Interface type at runtime for field "Query.pet". Either the "Pet" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.',
'Abstract type resolution for "Pet" for field "Query.pet" failed. Encountered abstract type "Pet" must resolve to an Object or Interface type at runtime. Either the "Pet" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.',
613
+
'Abstract type "Pet" must resolve to an Object type or an intermediate Interface type at runtime for field "Query.pet". Either the "Pet" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.',
614
614
);
615
615
616
616
expectError({forTypeName: 'Human'}).toEqual(
617
-
'Abstract type resolution for "Pet" for field "Query.pet" failed. Encountered abstract type "Pet" was resolved to a type "Human" that does not exist inside the schema.',
617
+
'Abstract type "Pet" was resolved to a type "Human" that does not exist inside the schema.',
618
618
);
619
619
620
620
expectError({forTypeName: 'String'}).toEqual(
621
-
'Abstract type resolution for "Pet" for field "Query.pet" failed. Encountered abstract type "Pet" was resolved to a non-object type "String".',
621
+
'Abstract type "Pet" was resolved to a non-object and non-interface type "String".',
622
622
);
623
623
624
624
expectError({forTypeName: '__Schema'}).toEqual(
625
-
'Abstract type resolution for "Pet" for field "Query.pet" failed. Runtime Object type "__Schema" is not a possible type for encountered abstract type "Pet".',
625
+
'Runtime Object type "__Schema" is not a possible type for "Pet".',
626
626
);
627
627
628
628
// FIXME: workaround since we can't inject resolveType into SDL
'Abstract type resolution for "Pet" for field "Query.pet" with value { __typename: undefined } failed. Encountered abstract type "Pet" must resolve to an Object or Interface type at runtime, received "[]".',
632
+
'Abstract type "Pet" must resolve to an Object type or an intermediate Interface type at runtime for field "Query.pet" with value { __typename: undefined }, received "[]".',
633
633
);
634
634
635
635
// FIXME: workaround since we can't inject resolveType into SDL
// FIXME: workaround since we can't inject resolveType into SDL
707
707
namedType.resolveType=()=>'Animal';
708
708
expectError().toEqual(
709
-
'Abstract type resolution for "Named" for field "Query.named" failed. Interface type "Animal" is not a subtype of encountered interface type "Named".',
709
+
'Interface type "Animal" is not a possible type for "Named".',
// FIXME: workaround since we can't inject resolveType into SDL
714
714
namedType.resolveType=()=>'Pet';
715
715
petType.resolveType=()=>'Person';
716
716
expectError().toEqual(
717
-
'Abstract type resolution for "Named" for field "Query.named" failed. Runtime Object type "Person" is not a possible type for encountered abstract type "Pet".',
717
+
'Runtime Object type "Person" is not a possible type for "Pet".',
718
718
);
719
719
720
720
// FIXME: workaround since we can't inject resolveType into SDL
721
721
namedType.resolveType=()=>'Pet';
722
722
petType.resolveType=()=>undefined;
723
723
expectError().toEqual(
724
-
'Abstract type resolution for "Named" for field "Query.named" failed. Encountered abstract type "Pet" must resolve to an Object or Interface type at runtime. Either the "Pet" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.',
724
+
'Abstract type "Pet" must resolve to an Object type or an intermediate Interface type at runtime for field "Query.named". Either the "Pet" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.',
725
725
);
726
726
727
727
// FIXME: workaround since we can't inject resolveType into SDL
728
728
petType.resolveType=()=>'Human';
729
729
expectError().toEqual(
730
-
'Abstract type resolution for "Named" for field "Query.named" failed. Encountered abstract type "Pet" was resolved to a type "Human" that does not exist inside the schema.',
730
+
'Abstract type "Pet" was resolved to a type "Human" that does not exist inside the schema.',
731
731
);
732
732
733
733
// FIXME: workaround since we can't inject resolveType into SDL
734
734
petType.resolveType=()=>'String';
735
735
expectError().toEqual(
736
-
'Abstract type resolution for "Named" for field "Query.named" failed. Encountered abstract type "Pet" was resolved to a non-object type "String".',
736
+
'Abstract type "Pet" was resolved to a non-object and non-interface type "String".',
737
737
);
738
738
739
739
// FIXME: workaround since we can't inject resolveType into SDL
740
740
petType.resolveType=()=>'__Schema';
741
741
expectError().toEqual(
742
-
'Abstract type resolution for "Named" for field "Query.named" failed. Runtime Object type "__Schema" is not a possible type for encountered abstract type "Pet".',
742
+
'Runtime Object type "__Schema" is not a possible type for "Pet".',
743
743
);
744
744
745
745
// FIXME: workaround since we can't inject resolveType into SDL
746
746
// @ts-expect-error
747
747
petType.resolveType=()=>[];
748
748
expectError().toEqual(
749
-
'Abstract type resolution for "Named" for field "Query.named" with value {} failed. Encountered abstract type "Pet" must resolve to an Object or Interface type at runtime, received "[]".',
749
+
'Abstract type "Pet" must resolve to an Object type or an intermediate Interface type at runtime for field "Query.named" with value {}, received "[]".',
750
750
);
751
751
752
752
// FIXME: workaround since we can't inject resolveType into SDL
753
753
petType.resolveType=()=>'Pet';
754
754
expectError().toEqual(
755
-
'Abstract type resolution for "Named" for field "Query.named" failed. Interface type "Pet" is not a subtype of encountered interface type "Named".',
755
+
'Interface type "Pet" is not a possible type for "Pet".',
@@ -834,8 +830,7 @@ function completeAbstractValueImpl(
834
830
returnruntimeTypeName.then((resolved)=>
835
831
completeAbstractValueImpl(
836
832
exeContext,
837
-
returnType,
838
-
currentAbstractType,
833
+
abstractType,
839
834
resolved,
840
835
fieldNodes,
841
836
info,
@@ -847,9 +842,7 @@ function completeAbstractValueImpl(
847
842
848
843
if(runtimeTypeName==null){
849
844
thrownewGraphQLError(
850
-
`Abstract type resolution for "${returnType.name}" for field "${info.parentType.name}.${info.fieldName}" failed. `+
851
-
`Encountered abstract type "${currentAbstractType.name}" must resolve to an Object or Interface type at runtime. `+
852
-
`Either the "${currentAbstractType.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,
845
+
`Abstract type "${abstractType.name}" must resolve to an Object type or an intermediate Interface type at runtime for field "${info.parentType.name}.${info.fieldName}". Either the "${abstractType.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,
853
846
{nodes: fieldNodes},
854
847
);
855
848
}
@@ -864,33 +857,29 @@ function completeAbstractValueImpl(
864
857
865
858
if(typeofruntimeTypeName!=='string'){
866
859
thrownewGraphQLError(
867
-
`Abstract type resolution for "${returnType.name}" for field "${info.parentType.name}.${info.fieldName}" `+
868
-
`with value ${inspect(result)} failed. `+
869
-
`Encountered abstract type "${currentAbstractType.name}" must resolve to an Object or Interface type at runtime, `+
870
-
`received "${inspect(runtimeTypeName)}".`,
860
+
`Abstract type "${abstractType.name}" must resolve to an Object type or an intermediate Interface type at runtime for field "${info.parentType.name}.${info.fieldName}" with `+
861
+
`value ${inspect(result)}, received "${inspect(runtimeTypeName)}".`,
0 commit comments