Why use IntrospectionFragmentMatcher?

我的梦境 提交于 2019-12-04 09:31:07

问题


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:

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.


回答1:


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




回答2:


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

this solved my issue.



来源:https://stackoverflow.com/questions/50451732/why-use-introspectionfragmentmatcher

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!