I'm getting this error while using the fragmentMatcher: new IntrospectionFragmentMatcher({...}) option when creating the ApolloClient. I'm using the fragment matcher so that I can make graphql requests which include fragments which match when an interface type is one of the subtypes.
I figured out the problem.
I constructed the IntrospectionFragmentMatcher in the following way:
const fragmentMatcher = new IntrospectionFragmentMatcher({
__schema: {
types: [
{
"kind": "INTERFACE",
"name": "User",
"possibleTypes": [
{"name": "Renter"},
{"name": "PropertyManager"},
{"name": "ServiceProfessional"}
]
},
]
}
});
when I'm actually supposed to construct it as
const fragmentMatcher = new IntrospectionFragmentMatcher({
introspectionQueryResultData: {
__schema: {
types: [
{
"kind": "INTERFACE",
"name": "User",
"possibleTypes": [
{"name": "Renter"},
{"name": "PropertyManager"},
{"name": "ServiceProfessional"}
]
},
]
}
}
});
Most helpful comment
I figured out the problem.
I constructed the IntrospectionFragmentMatcher in the following way:
when I'm actually supposed to construct it as