render-runtime icon indicating copy to clipboard operation
render-runtime copied to clipboard

Apollo cache does not support unions and interfaces

Open rafarubim opened this issue 6 years ago • 0 comments

I'm opening this issue to address the fact that the Apollo InMemoryCache instance created by render-runtime uses by default the HeuristicFragmentMatcher. Also it has no way (like an opt-in option) to use the IntrospectionFragmentMatcher.

This means that Queries or Mutations that use GraphQL Unions or Interfaces don't work correctly with the cache. For that reason, clients may have Query/Mutation issues without even knowing why data is incorrectly fetched (because the cache gets in the way).

IntrospectionFragmentMatcher poses the disadvantage of requiring schema-knowledge for correct execution (https://www.apollographql.com/docs/react/advanced/fragments/#fragments-on-unions-and-interfaces). An approach to make this feature available needs to be thoroughly thought of.

rafarubim avatar Jul 22 '19 13:07 rafarubim