@envelop/response-cache 6.0.0 → 6.0.1

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/plugin.js CHANGED
@@ -186,6 +186,11 @@ function useResponseCache({ cache = (0, in_memory_cache_js_1.createInMemoryCache
186
186
  delete data.__responseCacheTypeName;
187
187
  const entityId = data.__responseCacheId;
188
188
  delete data.__responseCacheId;
189
+ // Always process nested objects, even if we are skipping cache, to ensure the result is cleaned up
190
+ // of metadata fields added to the query document.
191
+ for (const fieldName in data) {
192
+ processResult(data[fieldName]);
193
+ }
189
194
  if (!skip) {
190
195
  if (ignoredTypesMap.has(typename) || (!sessionId && isPrivate(typename, data))) {
191
196
  skip = true;
@@ -206,7 +211,6 @@ function useResponseCache({ cache = (0, in_memory_cache_js_1.createInMemoryCache
206
211
  identifier.set(inferredType, { typename: inferredType });
207
212
  });
208
213
  }
209
- processResult(fieldData);
210
214
  }
211
215
  }
212
216
  }
package/esm/plugin.js CHANGED
@@ -179,6 +179,11 @@ export function useResponseCache({ cache = createInMemoryCache(), ttl: globalTtl
179
179
  delete data.__responseCacheTypeName;
180
180
  const entityId = data.__responseCacheId;
181
181
  delete data.__responseCacheId;
182
+ // Always process nested objects, even if we are skipping cache, to ensure the result is cleaned up
183
+ // of metadata fields added to the query document.
184
+ for (const fieldName in data) {
185
+ processResult(data[fieldName]);
186
+ }
182
187
  if (!skip) {
183
188
  if (ignoredTypesMap.has(typename) || (!sessionId && isPrivate(typename, data))) {
184
189
  skip = true;
@@ -199,7 +204,6 @@ export function useResponseCache({ cache = createInMemoryCache(), ttl: globalTtl
199
204
  identifier.set(inferredType, { typename: inferredType });
200
205
  });
201
206
  }
202
- processResult(fieldData);
203
207
  }
204
208
  }
205
209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envelop/response-cache",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "@envelop/core": "^5.0.0",