diff --git a/src/cache/inmemory/writeToStore.ts b/src/cache/inmemory/writeToStore.ts index 40cbb8fd73b..f3051beb4a4 100644 --- a/src/cache/inmemory/writeToStore.ts +++ b/src/cache/inmemory/writeToStore.ts @@ -127,18 +127,17 @@ export class StoreWriter { if (sets.indexOf(selectionSet) >= 0) return store; sets.push(selectionSet); - const entityRef = makeReference(dataId); const typename = // If the result has a __typename, trust that. getTypenameFromResult(result, selectionSet, context.fragmentMap) || // If the entity identified by dataId has a __typename in the store, // fall back to that. - store.getFieldValue(entityRef, "__typename"); + store.get(dataId, "__typename") as string; store.merge( dataId, policies.applyMerges( - entityRef, + makeReference(dataId), this.processSelectionSet({ result, selectionSet,