Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.

fix(core): add back cacheOutcome (#3464)

Changed files
+11 -8
.changeset
packages
core
src
exchanges
+5
.changeset/silly-pigs-return.md
···
+
---
+
'@urql/core': patch
+
---
+
+
Add back our cache-outcome on the document-cache, this was behind a development flag however in our normalized cache we always add it already
+6 -8
packages/core/src/exchanges/cache.ts
···
data: null,
});
-
if (process.env.NODE_ENV !== 'production') {
-
result = {
-
...result,
-
operation: addMetadata(operation, {
-
cacheOutcome: cachedResult ? 'hit' : 'miss',
-
}),
-
};
-
}
+
result = {
+
...result,
+
operation: addMetadata(operation, {
+
cacheOutcome: cachedResult ? 'hit' : 'miss',
+
}),
+
};
if (operation.context.requestPolicy === 'cache-and-network') {
result.stale = true;