From b3c39c1abb4f74e9a8cb6fc913a3b841d3df8a20 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Wed, 13 Dec 2023 08:22:06 +0100 Subject: [PATCH] add back cacheOutcome --- .changeset/silly-pigs-return.md | 5 +++++ packages/core/src/exchanges/cache.ts | 14 ++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 .changeset/silly-pigs-return.md diff --git a/.changeset/silly-pigs-return.md b/.changeset/silly-pigs-return.md new file mode 100644 index 0000000000..38d51ccd7f --- /dev/null +++ b/.changeset/silly-pigs-return.md @@ -0,0 +1,5 @@ +--- +'@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 diff --git a/packages/core/src/exchanges/cache.ts b/packages/core/src/exchanges/cache.ts index 31b9202f2b..b3f53ebef6 100755 --- a/packages/core/src/exchanges/cache.ts +++ b/packages/core/src/exchanges/cache.ts @@ -86,14 +86,12 @@ export const cacheExchange: Exchange = ({ forward, client, dispatchDebug }) => { 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;