Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use IntrospectionFragmentMatcher?

Tags:

apollo

Is there any reason to use IntrospectionFragmentMatcher to determine concrete types of values returned from interface and union fields?

I'm talking about apollo-client. I'm using InMemoryCache with addTypename: true, so the type is known the moment the client gets the response.

Meanwhile my console is plagued with warnings like these: console warnings

The only reason I see the documentation hint at is response validation. But why validate the server-sent response at all? If the server is not worth trusting, validation is useless anyway.

like image 963
kdojeteri Avatar asked May 21 '18 15:05

kdojeteri


2 Answers

If you're using useQuery then try fetchPolicy: 'no-cache'.

this solved my issue.

Only a fix if you're not using cache properly

like image 53
Yahya Ahmed Avatar answered Sep 19 '22 08:09

Yahya Ahmed


The warnings seem to be a bug in apollo. https://github.com/apollographql/apollo-client/issues/3397

like image 35
Andrew B. Avatar answered Sep 21 '22 08:09

Andrew B.