diff --git a/src/cache/inmemory/canon.ts b/src/cache/inmemory/object-canon.ts similarity index 97% rename from src/cache/inmemory/canon.ts rename to src/cache/inmemory/object-canon.ts index 7572c4fd4fa..2dc82210a7a 100644 --- a/src/cache/inmemory/canon.ts +++ b/src/cache/inmemory/object-canon.ts @@ -23,7 +23,7 @@ class Pass { // which usually means the objects are structurally equivalent (deeply // equal), but don't necessarily use the same memory. // -// Like a literary or musical canon, this Canon class represents a +// Like a literary or musical canon, this ObjectCanon class represents a // collection of unique canonical items (JavaScript objects), with the // important property that canon.admit(a) === canon.admit(b) if a and b // are deeply equal to each other. In terms of the definition above, the @@ -61,8 +61,8 @@ class Pass { // In the future, we may consider adding additional cases to the switch // statement to handle other common object types, such as "[object Date]" // objects, as needed. -export class Canon { - // Set of all canonical objects this Canon has admitted, allowing +export class ObjectCanon { + // Set of all canonical objects this ObjectCanon has admitted, allowing // canon.admit to return previously-canonicalized objects immediately. private known = new (canUseWeakMap ? WeakSet : Set)(); diff --git a/src/cache/inmemory/readFromStore.ts b/src/cache/inmemory/readFromStore.ts index 5414ce26de0..7d487bb890c 100644 --- a/src/cache/inmemory/readFromStore.ts +++ b/src/cache/inmemory/readFromStore.ts @@ -35,7 +35,7 @@ import { getTypenameFromStoreObject } from './helpers'; import { Policies } from './policies'; import { InMemoryCache } from './inMemoryCache'; import { MissingFieldError } from '../core/types/common'; -import { Canon } from './canon'; +import { ObjectCanon } from './object-canon'; export type VariableMap = { [name: string]: any }; @@ -326,7 +326,7 @@ export class StoreReader { return finalResult; } - private canon = new Canon; + private canon = new ObjectCanon; private knownResults = new WeakMap, SelectionSetNode>();