Skip to content

Apollo cache does not support unions and interfaces #356

Description

@rafarubim

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions