@graphql-yoga/plugin-response-cache 3.3.0-rc-20240116104337-ae0790aa → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -110,11 +110,15 @@ function useResponseCache(options) {
110
110
  if (enabled(request)) {
111
111
  const cachedResponse = await cache.get(operationId);
112
112
  if (cachedResponse) {
113
+ const responseWithSymbol = {
114
+ ...cachedResponse,
115
+ [Symbol.for('servedFromResponseCache')]: true,
116
+ };
113
117
  if (options.includeExtensionMetadata) {
114
- setResult((0, response_cache_1.resultWithMetadata)(cachedResponse, { hit: true }));
118
+ setResult((0, response_cache_1.resultWithMetadata)(responseWithSymbol, { hit: true }));
115
119
  }
116
120
  else {
117
- setResult(cachedResponse);
121
+ setResult(responseWithSymbol);
118
122
  }
119
123
  return;
120
124
  }
package/esm/index.js CHANGED
@@ -105,11 +105,15 @@ export function useResponseCache(options) {
105
105
  if (enabled(request)) {
106
106
  const cachedResponse = await cache.get(operationId);
107
107
  if (cachedResponse) {
108
+ const responseWithSymbol = {
109
+ ...cachedResponse,
110
+ [Symbol.for('servedFromResponseCache')]: true,
111
+ };
108
112
  if (options.includeExtensionMetadata) {
109
- setResult(resultWithMetadata(cachedResponse, { hit: true }));
113
+ setResult(resultWithMetadata(responseWithSymbol, { hit: true }));
110
114
  }
111
115
  else {
112
- setResult(cachedResponse);
116
+ setResult(responseWithSymbol);
113
117
  }
114
118
  return;
115
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-yoga/plugin-response-cache",
3
- "version": "3.3.0-rc-20240116104337-ae0790aa",
3
+ "version": "3.3.0",
4
4
  "description": "",
5
5
  "peerDependencies": {
6
6
  "graphql": "^15.2.0 || ^16.0.0",