11

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.

kdojeteri
  • 755
  • 6
  • 17
  • I would like to point out that an issue is currently open for this: https://github.com/apollographql/apollo-client/issues/4202 – kdojeteri Sep 16 '19 at 05:53

2 Answers2

4

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

Andrew B.
  • 1,225
  • 1
  • 13
  • 18
  • I think this should be the accepted answer. @peping I think you are right, and I going to create a new bug as the above bug has been closed. – Charlie-Greenman Dec 02 '18 at 01:57
3

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

this solved my issue.

Only a fix if you're not using cache properly

Yahya Ahmed
  • 375
  • 1
  • 13
  • 4
    Just as a side note, it not solves actual problem. I mean, if you want to save data in cache then this is not an option. – Vano Aug 07 '20 at 08:51