@@ -28,10 +28,7 @@ import {
2828 StubDataObjectList
2929} from './util' ;
3030
31- /**
32- * Interface for a stub result tree, with fields which are stub data objects.
33- * @public
34- */
31+ /** Interface for a stub result tree, with fields which are stub data objects. */
3532export interface StubResultTree {
3633 [ alias : string ] :
3734 | SelectionSet
@@ -40,10 +37,7 @@ export interface StubResultTree {
4037 | StubDataObjectList ;
4138}
4239
43- /**
44- * A class used to hold an entity's normalized cached values across all queries.
45- * @public
46- */
40+ /** A class used to hold an entity's normalized cached values across all queries. */
4741class BackingDataObject {
4842 /** Stable unique key identifying the entity across types. Format: TypeName|ID */
4943 readonly typedKey : string ;
@@ -109,10 +103,7 @@ class BackingDataObject {
109103 }
110104}
111105
112- /**
113- * A class representing the cache for query results and entity data.
114- * @public
115- */
106+ /** A class representing the cache for query results and entity data. */
116107export class Cache {
117108 /** A map of (srtCacheKey --> StubResultTree returned from that query). */
118109 private srtCache = new Map < string , StubResultTree > ( ) ;
@@ -161,7 +152,7 @@ export class Cache {
161152 /**
162153 * Creates a StubResultTree based on the data returned from a query
163154 * @param data the data property of the query result
164- * @returns
155+ * @returns the StubResultTree
165156 */
166157 private createSrt ( data : QueryData ) : StubResultTree {
167158 const srt : StubResultTree = { } ;
@@ -221,6 +212,11 @@ export class Cache {
221212 return cachedSelectionSet ;
222213 }
223214
215+ /**
216+ * Caches a single field's value. If the value is a selection set, it recursively normalizes it.
217+ * @param value The field value to cache.
218+ * @returns The cached field value, which might be a StubDataObject if it was a normalizeable selection set.
219+ */
224220 private cacheField ( value : Field ) : Field {
225221 if ( isSelectionSet ( value ) ) {
226222 // recurse, and replace cacheable selection sets with SDOs
0 commit comments