diff --git a/src/cache/inmemory/inMemoryCache.ts b/src/cache/inmemory/inMemoryCache.ts index afb5dbc2657..01565735eed 100644 --- a/src/cache/inmemory/inMemoryCache.ts +++ b/src/cache/inmemory/inMemoryCache.ts @@ -42,12 +42,16 @@ export class InMemoryCache extends ApolloCache { protected config: InMemoryCacheConfig; private watches = new Set(); private addTypename: boolean; - private policies: Policies; private typenameDocumentCache = new Map(); private storeReader: StoreReader; private storeWriter: StoreWriter; + // Dynamically imported code can augment existing typePolicies or + // possibleTypes by calling cache.policies.addTypePolicies or + // cache.policies.addPossibletypes. + public readonly policies: Policies; + // Set this while in a transaction to prevent broadcasts... // don't forget to turn it back on! private silenceBroadcast: boolean = false;