Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
operation: addMetadata(operation, {
cacheOutcome: cachedResult ? 'hit' : 'miss',
}),
};
if (operation.context.requestPolicy === 'cache-and-network') {
result.fetching = true;
reexecuteOperation(client, operation);
}
return result;
})
);
const forwardedOps$ = pipe(
merge([
pipe(
sharedOps$,
filter(op => !shouldSkip(op) && !isOperationCached(op)),
map(mapTypeNames)
),
pipe(
sharedOps$,
filter(op => shouldSkip(op))
),
]),
map(op => addMetadata(op, { cacheOutcome: 'miss' })),
forward,
tap(response => {
if (
response.operation &&
response.operation.operationName === 'mutation'