apollo-cache-hermes icon indicating copy to clipboard operation
apollo-cache-hermes copied to clipboard

bug: `GraphSnapshot` is not exported (but should be)

Open jorroll opened this issue 6 years ago • 0 comments

Summary: ApolloClient is a generic class which expects a TCacheShape type argument. When using Hermes, that cache shape type (appears to be) GraphSnapshot.

Expected Behavior: GraphSnapshot should be exported so that end users can use it where required/expected by Apollo classes / tools.

Actual Behavior: GraphSnapshot is not exported.

Example code which does not currently work:

const link = new WebSocketLink(
  new SubscriptionClient(WS_URI, {
    reconnect: true,
  }),
);

const cache = new Hermes({ addTypename: true });

// ERROR! `GraphSnapshot` is not exported!
const options: ApolloClientOptions<GraphSnapshot> = { link, cache };

jorroll avatar Jul 25 '19 16:07 jorroll