@graphql-box/cache-manager 3.2.2 → 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.
Files changed (41) hide show
  1. package/lib/browser/index.js +1 -1
  2. package/lib/browser/index.js.map +1 -1
  3. package/lib/browser/production.analysis.txt +25 -29
  4. package/lib/main/consts/index.js +1 -7
  5. package/lib/main/consts/index.js.map +1 -1
  6. package/lib/main/debug/log-cache-entry/index.js +4 -2
  7. package/lib/main/debug/log-cache-entry/index.js.map +1 -1
  8. package/lib/main/debug/log-cache-query/index.js +4 -2
  9. package/lib/main/debug/log-cache-query/index.js.map +1 -1
  10. package/lib/main/debug/log-partial-compiled/index.js +4 -2
  11. package/lib/main/debug/log-partial-compiled/index.js.map +1 -1
  12. package/lib/main/index.js +0 -23
  13. package/lib/main/index.js.map +1 -1
  14. package/lib/main/main/index.js +5 -5
  15. package/lib/main/main/index.js.map +1 -1
  16. package/lib/module/consts/index.js +0 -3
  17. package/lib/module/consts/index.js.map +1 -1
  18. package/lib/module/debug/log-cache-entry/index.js +3 -1
  19. package/lib/module/debug/log-cache-entry/index.js.map +1 -1
  20. package/lib/module/debug/log-cache-query/index.js +3 -1
  21. package/lib/module/debug/log-cache-query/index.js.map +1 -1
  22. package/lib/module/debug/log-partial-compiled/index.js +3 -1
  23. package/lib/module/debug/log-partial-compiled/index.js.map +1 -1
  24. package/lib/module/index.js +0 -1
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/module/main/index.js +5 -5
  27. package/lib/module/main/index.js.map +1 -1
  28. package/lib/types/consts/index.d.ts +0 -3
  29. package/lib/types/consts/index.d.ts.map +1 -1
  30. package/lib/types/debug/log-cache-entry/index.d.ts.map +1 -1
  31. package/lib/types/debug/log-cache-query/index.d.ts.map +1 -1
  32. package/lib/types/debug/log-partial-compiled/index.d.ts.map +1 -1
  33. package/lib/types/index.d.ts +0 -1
  34. package/lib/types/index.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/src/consts/index.ts +0 -4
  37. package/src/debug/log-cache-entry/index.ts +3 -3
  38. package/src/debug/log-cache-query/index.ts +3 -3
  39. package/src/debug/log-partial-compiled/index.ts +3 -3
  40. package/src/index.ts +0 -1
  41. package/src/main/index.ts +5 -5
@@ -1,5 +1,4 @@
1
- import { RequestContext } from "@graphql-box/core";
2
- import { PARTIAL_QUERY_COMPILED } from "../../consts";
1
+ import { PARTIAL_QUERY_COMPILED, RequestContext } from "@graphql-box/core";
3
2
 
4
3
  export default function logPartialCompiled() {
5
4
  return (
@@ -12,7 +11,7 @@ export default function logPartialCompiled() {
12
11
 
13
12
  descriptor.value = async function descriptorValue(...args: any[]): Promise<any> {
14
13
  return new Promise<void>(async resolve => {
15
- const { debugManager, ...otherContext } = args[3] as RequestContext;
14
+ const { debugManager, requestID, ...otherContext } = args[3] as RequestContext;
16
15
 
17
16
  if (!debugManager) {
18
17
  await method.apply(this, args);
@@ -31,6 +30,7 @@ export default function logPartialCompiled() {
31
30
  hash: args[0],
32
31
  options: args[2],
33
32
  partialQueryResponse: args[1],
33
+ requestID,
34
34
  stats: { duration, endTime, startTime },
35
35
  });
36
36
  });
package/src/index.ts CHANGED
@@ -1,3 +1,2 @@
1
- export { CACHE_ENTRY_ADDED, CACHE_ENTRY_QUERIED, PARTIAL_QUERY_COMPILED } from "./consts";
2
1
  export * from "./defs";
3
2
  export { default, CacheManager } from "./main";
package/src/main/index.ts CHANGED
@@ -906,10 +906,10 @@ export class CacheManager implements CacheManagerDef {
906
906
  context: CacheManagerContext,
907
907
  ) {
908
908
  const responseChunks = this._responseChunksAwaitingCaching.get(
909
- context.boxID,
909
+ context.requestID,
910
910
  ) as RawResponseDataWithMaybeCacheMetadata[];
911
911
 
912
- this._responseChunksAwaitingCaching.delete(context.boxID);
912
+ this._responseChunksAwaitingCaching.delete(context.requestID);
913
913
  return mergeResponseDataSets([...responseChunks, normalizedResponseData]);
914
914
  }
915
915
 
@@ -1170,12 +1170,12 @@ export class CacheManager implements CacheManagerDef {
1170
1170
  normalizedResponseData: RawResponseDataWithMaybeCacheMetadata,
1171
1171
  context: CacheManagerContext,
1172
1172
  ) {
1173
- const responseChunks = this._responseChunksAwaitingCaching.get(context.boxID);
1173
+ const responseChunks = this._responseChunksAwaitingCaching.get(context.requestID);
1174
1174
 
1175
1175
  if (responseChunks) {
1176
- this._responseChunksAwaitingCaching.set(context.boxID, [...responseChunks, normalizedResponseData]);
1176
+ this._responseChunksAwaitingCaching.set(context.requestID, [...responseChunks, normalizedResponseData]);
1177
1177
  } else {
1178
- this._responseChunksAwaitingCaching.set(context.boxID, [normalizedResponseData]);
1178
+ this._responseChunksAwaitingCaching.set(context.requestID, [normalizedResponseData]);
1179
1179
  }
1180
1180
  }
1181
1181
  }