diff --git a/.changeset/twelve-beds-appear.md b/.changeset/twelve-beds-appear.md new file mode 100644 index 0000000000..06cd96232b --- /dev/null +++ b/.changeset/twelve-beds-appear.md @@ -0,0 +1,5 @@ +--- +'@urql/exchange-graphcache': patch +--- + +Fix referential equality preservation in Graphcache failing after API results, due to a typo writing the API result rather than the updated cache result. diff --git a/exchanges/graphcache/src/cacheExchange.ts b/exchanges/graphcache/src/cacheExchange.ts index fe0d1f3ab5..ea85c805d3 100644 --- a/exchanges/graphcache/src/cacheExchange.ts +++ b/exchanges/graphcache/src/cacheExchange.ts @@ -233,7 +233,7 @@ export const cacheExchange = >( // Collect the query's dependencies for future pending operation updates queryDependencies = queryResult.dependencies; collectPendingOperations(pendingOperations, queryDependencies); - results.set(operation.key, result.data); + results.set(operation.key, data); } } else { noopDataState(store.data, operation.key);