Skip to content

Commit

Permalink
Make cache.policies public to support dynamic policy loading.
Browse files Browse the repository at this point in the history
A small step towards implementing
#5750 (comment).
  • Loading branch information
benjamn committed Jan 25, 2020
1 parent 73cafe9 commit af0a03f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cache/inmemory/inMemoryCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ export class InMemoryCache extends ApolloCache<NormalizedCacheObject> {
protected config: InMemoryCacheConfig;
private watches = new Set<Cache.WatchOptions>();
private addTypename: boolean;
private policies: Policies;

private typenameDocumentCache = new Map<DocumentNode, DocumentNode>();
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;
Expand Down

0 comments on commit af0a03f

Please sign in to comment.