@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.
- package/lib/browser/index.js +1 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/production.analysis.txt +25 -29
- package/lib/main/consts/index.js +1 -7
- package/lib/main/consts/index.js.map +1 -1
- package/lib/main/debug/log-cache-entry/index.js +4 -2
- package/lib/main/debug/log-cache-entry/index.js.map +1 -1
- package/lib/main/debug/log-cache-query/index.js +4 -2
- package/lib/main/debug/log-cache-query/index.js.map +1 -1
- package/lib/main/debug/log-partial-compiled/index.js +4 -2
- package/lib/main/debug/log-partial-compiled/index.js.map +1 -1
- package/lib/main/index.js +0 -23
- package/lib/main/index.js.map +1 -1
- package/lib/main/main/index.js +5 -5
- package/lib/main/main/index.js.map +1 -1
- package/lib/module/consts/index.js +0 -3
- package/lib/module/consts/index.js.map +1 -1
- package/lib/module/debug/log-cache-entry/index.js +3 -1
- package/lib/module/debug/log-cache-entry/index.js.map +1 -1
- package/lib/module/debug/log-cache-query/index.js +3 -1
- package/lib/module/debug/log-cache-query/index.js.map +1 -1
- package/lib/module/debug/log-partial-compiled/index.js +3 -1
- package/lib/module/debug/log-partial-compiled/index.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/main/index.js +5 -5
- package/lib/module/main/index.js.map +1 -1
- package/lib/types/consts/index.d.ts +0 -3
- package/lib/types/consts/index.d.ts.map +1 -1
- package/lib/types/debug/log-cache-entry/index.d.ts.map +1 -1
- package/lib/types/debug/log-cache-query/index.d.ts.map +1 -1
- package/lib/types/debug/log-partial-compiled/index.d.ts.map +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/consts/index.ts +0 -4
- package/src/debug/log-cache-entry/index.ts +3 -3
- package/src/debug/log-cache-query/index.ts +3 -3
- package/src/debug/log-partial-compiled/index.ts +3 -3
- package/src/index.ts +0 -1
- 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
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.
|
|
909
|
+
context.requestID,
|
|
910
910
|
) as RawResponseDataWithMaybeCacheMetadata[];
|
|
911
911
|
|
|
912
|
-
this._responseChunksAwaitingCaching.delete(context.
|
|
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.
|
|
1173
|
+
const responseChunks = this._responseChunksAwaitingCaching.get(context.requestID);
|
|
1174
1174
|
|
|
1175
1175
|
if (responseChunks) {
|
|
1176
|
-
this._responseChunksAwaitingCaching.set(context.
|
|
1176
|
+
this._responseChunksAwaitingCaching.set(context.requestID, [...responseChunks, normalizedResponseData]);
|
|
1177
1177
|
} else {
|
|
1178
|
-
this._responseChunksAwaitingCaching.set(context.
|
|
1178
|
+
this._responseChunksAwaitingCaching.set(context.requestID, [normalizedResponseData]);
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
1181
|
}
|