@graphql-box/cache-manager 3.2.0 → 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 (44) 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 +42 -46
  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 +11 -4
  7. package/lib/main/debug/log-cache-entry/index.js.map +1 -1
  8. package/lib/main/debug/log-cache-query/index.js +11 -4
  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 +21 -12
  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 +11 -4
  19. package/lib/module/debug/log-cache-entry/index.js.map +1 -1
  20. package/lib/module/debug/log-cache-query/index.js +11 -4
  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 +21 -12
  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/lib/types/main/index.d.ts +3 -1
  36. package/lib/types/main/index.d.ts.map +1 -1
  37. package/package.json +1 -1
  38. package/src/__snapshots__/index.test.ts.snap +1082 -1082
  39. package/src/consts/index.ts +0 -4
  40. package/src/debug/log-cache-entry/index.ts +10 -5
  41. package/src/debug/log-cache-query/index.ts +10 -5
  42. package/src/debug/log-partial-compiled/index.ts +3 -3
  43. package/src/index.ts +0 -1
  44. package/src/main/index.ts +22 -15
@@ -1,50 +1,50 @@
1
1
  -----------------------------
2
2
  Rollup File Analysis
3
3
  -----------------------------
4
- bundle size: 91.643 KB
5
- original size: 62.603 KB
4
+ bundle size: 94.892 KB
5
+ original size: 63.186 KB
6
6
  code reduction: 0 %
7
7
  module count: 24
8
8
 
9
9
  ███████████████████████████████████░░░░░░░░░░░░░░░
10
10
  file: /src/main/index.ts
11
- bundle space: 71.96 %
12
- rendered size: 65.946 KB
13
- original size: 38.051 KB
11
+ bundle space: 70.23 %
12
+ rendered size: 66.645 KB
13
+ original size: 38.491 KB
14
14
  code reduction: 0 %
15
15
  dependents: 1
16
16
  - /src/index.ts
17
17
 
18
18
  ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
19
19
  file: /src/debug/log-cache-query/index.ts
20
- bundle space: 4.19 %
21
- rendered size: 3.839 KB
22
- original size: 1.282 KB
20
+ bundle space: 5.41 %
21
+ rendered size: 5.135 KB
22
+ original size: 1.492 KB
23
23
  code reduction: 0 %
24
24
  dependents: 1
25
25
  - /src/debug/index.ts
26
26
 
27
- █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
27
+ ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
28
28
  file: /src/debug/log-cache-entry/index.ts
29
- bundle space: 3.77 %
30
- rendered size: 3.451 KB
31
- original size: 1.197 KB
29
+ bundle space: 4.99 %
30
+ rendered size: 4.737 KB
31
+ original size: 1.397 KB
32
32
  code reduction: 0 %
33
33
  dependents: 1
34
34
  - /src/debug/index.ts
35
35
 
36
36
  █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
37
37
  file: /src/debug/log-partial-compiled/index.ts
38
- bundle space: 3.68 %
39
- rendered size: 3.37 KB
40
- original size: 1.161 KB
38
+ bundle space: 3.66 %
39
+ rendered size: 3.475 KB
40
+ original size: 1.162 KB
41
41
  code reduction: 0 %
42
42
  dependents: 1
43
43
  - /src/debug/index.ts
44
44
 
45
45
  █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
46
46
  file: /src/helpers/filterField.ts
47
- bundle space: 3.09 %
47
+ bundle space: 2.99 %
48
48
  rendered size: 2.834 KB
49
49
  original size: 2.94 KB
50
50
  code reduction: 3.61 %
@@ -54,8 +54,8 @@ dependents: 2
54
54
 
55
55
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
56
56
  file: /src/helpers/mergeResponseDataSets.ts
57
- bundle space: 1.87 %
58
- rendered size: 1.716 KB
57
+ bundle space: 1.82 %
58
+ rendered size: 1.728 KB
59
59
  original size: 907 Bytes
60
60
  code reduction: 0 %
61
61
  dependents: 1
@@ -63,7 +63,7 @@ dependents: 1
63
63
 
64
64
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
65
65
  file: /src/helpers/filterFragmentDefinitions.ts
66
- bundle space: 1.6 %
66
+ bundle space: 1.54 %
67
67
  rendered size: 1.462 KB
68
68
  original size: 1.517 KB
69
69
  code reduction: 3.63 %
@@ -72,7 +72,7 @@ dependents: 1
72
72
 
73
73
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
74
74
  file: /src/helpers/normalizePatchResponseData.ts
75
- bundle space: 1.43 %
75
+ bundle space: 1.38 %
76
76
  rendered size: 1.309 KB
77
77
  original size: 478 Bytes
78
78
  code reduction: 0 %
@@ -81,7 +81,7 @@ dependents: 1
81
81
 
82
82
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
83
83
  file: /src/helpers/filterQuery.ts
84
- bundle space: 1.22 %
84
+ bundle space: 1.18 %
85
85
  rendered size: 1.117 KB
86
86
  original size: 1.49 KB
87
87
  code reduction: 25.03 %
@@ -90,7 +90,7 @@ dependents: 1
90
90
 
91
91
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
92
92
  file: /src/helpers/filterIDsAndTypeNames.ts
93
- bundle space: 1.09 %
93
+ bundle space: 1.05 %
94
94
  rendered size: 998 Bytes
95
95
  original size: 1.165 KB
96
96
  code reduction: 14.33 %
@@ -99,7 +99,7 @@ dependents: 1
99
99
 
100
100
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
101
101
  file: /src/helpers/checkFieldPathChecklist.ts
102
- bundle space: 1.04 %
102
+ bundle space: 1.01 %
103
103
  rendered size: 957 Bytes
104
104
  original size: 828 Bytes
105
105
  code reduction: 0 %
@@ -108,7 +108,7 @@ dependents: 1
108
108
 
109
109
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
110
110
  file: /src/helpers/filterOutPropsWithArgsOrDirectives.ts
111
- bundle space: 1.01 %
111
+ bundle space: 0.98 %
112
112
  rendered size: 927 Bytes
113
113
  original size: 1.081 KB
114
114
  code reduction: 14.25 %
@@ -117,7 +117,7 @@ dependents: 1
117
117
 
118
118
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
119
119
  file: /src/helpers/filterInlineFragments.ts
120
- bundle space: 0.86 %
120
+ bundle space: 0.83 %
121
121
  rendered size: 788 Bytes
122
122
  original size: 999 Bytes
123
123
  code reduction: 21.12 %
@@ -126,7 +126,7 @@ dependents: 1
126
126
 
127
127
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
128
128
  file: /src/helpers/deriveOpCacheability.ts
129
- bundle space: 0.86 %
129
+ bundle space: 0.83 %
130
130
  rendered size: 786 Bytes
131
131
  original size: 858 Bytes
132
132
  code reduction: 8.39 %
@@ -135,7 +135,7 @@ dependents: 1
135
135
 
136
136
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
137
137
  file: /src/helpers/filterFragmentSpreads.ts
138
- bundle space: 0.67 %
138
+ bundle space: 0.65 %
139
139
  rendered size: 616 Bytes
140
140
  original size: 942 Bytes
141
141
  code reduction: 34.61 %
@@ -144,36 +144,32 @@ dependents: 1
144
144
 
145
145
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
146
146
  file: /src/helpers/createFragmentSpreadChecklist.ts
147
- bundle space: 0.5 %
147
+ bundle space: 0.48 %
148
148
  rendered size: 457 Bytes
149
149
  original size: 572 Bytes
150
150
  code reduction: 20.1 %
151
151
  dependents: 1
152
152
  - /src/helpers/filterQuery.ts
153
153
 
154
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
155
- file: /src/consts/index.ts
156
- bundle space: 0.34 %
157
- rendered size: 315 Bytes
158
- original size: 390 Bytes
159
- code reduction: 19.23 %
160
- dependents: 6
161
- - /src/debug/log-cache-entry/index.ts
162
- - /src/debug/log-cache-query/index.ts
163
- - /src/debug/log-partial-compiled/index.ts
164
- - /src/helpers/deriveOpCacheability.ts
165
- - /src/main/index.ts
166
- - /src/index.ts
167
-
168
154
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
169
155
  file: /src/helpers/validTypeIDValue.ts
170
- bundle space: 0.34 %
156
+ bundle space: 0.33 %
171
157
  rendered size: 309 Bytes
172
158
  original size: 426 Bytes
173
159
  code reduction: 27.46 %
174
160
  dependents: 1
175
161
  - /src/main/index.ts
176
162
 
163
+ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
164
+ file: /src/consts/index.ts
165
+ bundle space: 0.17 %
166
+ rendered size: 166 Bytes
167
+ original size: 213 Bytes
168
+ code reduction: 22.07 %
169
+ dependents: 2
170
+ - /src/helpers/deriveOpCacheability.ts
171
+ - /src/main/index.ts
172
+
177
173
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
178
174
  file: /src/helpers/isNotResponseChunk.ts
179
175
  bundle space: 0.17 %
@@ -185,7 +181,7 @@ dependents: 1
185
181
 
186
182
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
187
183
  file: /src/helpers/isLastResponseChunk.ts
188
- bundle space: 0.17 %
184
+ bundle space: 0.16 %
189
185
  rendered size: 156 Bytes
190
186
  original size: 304 Bytes
191
187
  code reduction: 48.68 %
@@ -194,7 +190,7 @@ dependents: 1
194
190
 
195
191
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
196
192
  file: /src/helpers/isNotLastResponseChunk.ts
197
- bundle space: 0.15 %
193
+ bundle space: 0.14 %
198
194
  rendered size: 133 Bytes
199
195
  original size: 278 Bytes
200
196
  code reduction: 52.16 %
@@ -223,7 +219,7 @@ dependents: 1
223
219
  file: /src/index.ts
224
220
  bundle space: 0 %
225
221
  rendered size: 0 Byte
226
- original size: 163 Bytes
222
+ original size: 72 Bytes
227
223
  code reduction: 100 %
228
224
  dependents: 0
229
225
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.PARTIAL_QUERY_COMPILED = exports.CACHE_ENTRY_QUERIED = exports.CACHE_ENTRY_ADDED = exports.HEADER_NO_CACHE = exports.HEADER_CACHE_CONTROL = exports.NO_CACHE = exports.CACHE_CONTROL = exports.METADATA = void 0;
6
+ exports.HEADER_NO_CACHE = exports.HEADER_CACHE_CONTROL = exports.NO_CACHE = exports.CACHE_CONTROL = exports.METADATA = void 0;
7
7
  const METADATA = "metadata";
8
8
  exports.METADATA = METADATA;
9
9
  const CACHE_CONTROL = "cacheControl";
@@ -14,10 +14,4 @@ const HEADER_CACHE_CONTROL = "cache-control";
14
14
  exports.HEADER_CACHE_CONTROL = HEADER_CACHE_CONTROL;
15
15
  const HEADER_NO_CACHE = "no-cache";
16
16
  exports.HEADER_NO_CACHE = HEADER_NO_CACHE;
17
- const CACHE_ENTRY_ADDED = "cache_entry_added";
18
- exports.CACHE_ENTRY_ADDED = CACHE_ENTRY_ADDED;
19
- const CACHE_ENTRY_QUERIED = "cache_entry_queried";
20
- exports.CACHE_ENTRY_QUERIED = CACHE_ENTRY_QUERIED;
21
- const PARTIAL_QUERY_COMPILED = "partial_query_compiled";
22
- exports.PARTIAL_QUERY_COMPILED = PARTIAL_QUERY_COMPILED;
23
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/consts/index.ts"],"names":["METADATA","CACHE_CONTROL","NO_CACHE","HEADER_CACHE_CONTROL","HEADER_NO_CACHE","CACHE_ENTRY_ADDED","CACHE_ENTRY_QUERIED","PARTIAL_QUERY_COMPILED"],"mappings":";;;;;;AAAO,MAAMA,QAAQ,GAAG,UAAjB;;AACA,MAAMC,aAAa,GAAG,cAAtB;;AACA,MAAMC,QAAQ,GAAG,SAAjB;;AAEA,MAAMC,oBAAoB,GAAG,eAA7B;;AACA,MAAMC,eAAe,GAAG,UAAxB;;AAEA,MAAMC,iBAAiB,GAAG,mBAA1B;;AACA,MAAMC,mBAAmB,GAAG,qBAA5B;;AACA,MAAMC,sBAAsB,GAAG,wBAA/B","sourcesContent":["export const METADATA = \"metadata\";\nexport const CACHE_CONTROL = \"cacheControl\";\nexport const NO_CACHE = \"noCache\";\n\nexport const HEADER_CACHE_CONTROL = \"cache-control\";\nexport const HEADER_NO_CACHE = \"no-cache\";\n\nexport const CACHE_ENTRY_ADDED = \"cache_entry_added\";\nexport const CACHE_ENTRY_QUERIED = \"cache_entry_queried\";\nexport const PARTIAL_QUERY_COMPILED = \"partial_query_compiled\";\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/consts/index.ts"],"names":["METADATA","CACHE_CONTROL","NO_CACHE","HEADER_CACHE_CONTROL","HEADER_NO_CACHE"],"mappings":";;;;;;AAAO,MAAMA,QAAQ,GAAG,UAAjB;;AACA,MAAMC,aAAa,GAAG,cAAtB;;AACA,MAAMC,QAAQ,GAAG,SAAjB;;AAEA,MAAMC,oBAAoB,GAAG,eAA7B;;AACA,MAAMC,eAAe,GAAG,UAAxB","sourcesContent":["export const METADATA = \"metadata\";\nexport const CACHE_CONTROL = \"cacheControl\";\nexport const NO_CACHE = \"noCache\";\n\nexport const HEADER_CACHE_CONTROL = \"cache-control\";\nexport const HEADER_NO_CACHE = \"no-cache\";\n"],"file":"index.js"}
@@ -7,7 +7,7 @@ exports.default = logCacheEntry;
7
7
 
8
8
  require("core-js/modules/es.promise.js");
9
9
 
10
- var _consts = require("../../consts");
10
+ var _core = require("@graphql-box/core");
11
11
 
12
12
  function logCacheEntry() {
13
13
  return (_target, _propertyName, descriptor) => {
@@ -18,6 +18,8 @@ function logCacheEntry() {
18
18
  return new Promise(async resolve => {
19
19
  const {
20
20
  debugManager,
21
+ requestFieldCacheKey,
22
+ requestID,
21
23
  ...otherContext
22
24
  } = args[5];
23
25
 
@@ -32,19 +34,24 @@ function logCacheEntry() {
32
34
  const endTime = debugManager.now();
33
35
  const duration = endTime - startTime;
34
36
  resolve();
35
- debugManager.emit(_consts.CACHE_ENTRY_ADDED, {
37
+ const payload = {
36
38
  cachemapOptions: args[3],
37
39
  cacheType: args[0],
38
40
  context: otherContext,
39
41
  hash: args[1],
40
42
  options: args[4],
43
+ requestID,
41
44
  stats: {
42
45
  duration,
43
46
  endTime,
44
47
  startTime
45
48
  },
46
- value: args[2]
47
- });
49
+ value: args[2],
50
+ ...(requestFieldCacheKey ? {
51
+ decryptedCacheKey: requestFieldCacheKey
52
+ } : {})
53
+ };
54
+ debugManager.emit(_core.CACHE_ENTRY_ADDED, payload);
48
55
  });
49
56
  };
50
57
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/debug/log-cache-entry/index.ts"],"names":["logCacheEntry","_target","_propertyName","descriptor","method","value","descriptorValue","args","Promise","resolve","debugManager","otherContext","apply","startTime","now","endTime","duration","emit","CACHE_ENTRY_ADDED","cachemapOptions","cacheType","context","hash","options","stats"],"mappings":";;;;;;;;;AACA;;AAEe,SAASA,aAAT,GAAyB;AACtC,SAAO,CACLC,OADK,EAELC,aAFK,EAGLC,UAHK,KAII;AACT,UAAMC,MAAM,GAAGD,UAAU,CAACE,KAA1B;AACA,QAAI,CAACD,MAAL,EAAa;;AAEbD,IAAAA,UAAU,CAACE,KAAX,GAAmB,eAAeC,eAAf,CAA+B,GAAGC,IAAlC,EAA6D;AAC9E,aAAO,IAAIC,OAAJ,CAAkB,MAAMC,OAAN,IAAiB;AACxC,cAAM;AAAEC,UAAAA,YAAF;AAAgB,aAAGC;AAAnB,YAAoCJ,IAAI,CAAC,CAAD,CAA9C;;AAEA,YAAI,CAACG,YAAL,EAAmB;AACjB,gBAAMN,MAAM,CAACQ,KAAP,CAAa,IAAb,EAAmBL,IAAnB,CAAN;AACAE,UAAAA,OAAO;AACP;AACD;;AAED,cAAMI,SAAS,GAAGH,YAAY,CAACI,GAAb,EAAlB;AACA,cAAMV,MAAM,CAACQ,KAAP,CAAa,IAAb,EAAmBL,IAAnB,CAAN;AACA,cAAMQ,OAAO,GAAGL,YAAY,CAACI,GAAb,EAAhB;AACA,cAAME,QAAQ,GAAGD,OAAO,GAAGF,SAA3B;AACAJ,QAAAA,OAAO;AAEPC,QAAAA,YAAY,CAACO,IAAb,CAAkBC,yBAAlB,EAAqC;AACnCC,UAAAA,eAAe,EAAEZ,IAAI,CAAC,CAAD,CADc;AAEnCa,UAAAA,SAAS,EAAEb,IAAI,CAAC,CAAD,CAFoB;AAGnCc,UAAAA,OAAO,EAAEV,YAH0B;AAInCW,UAAAA,IAAI,EAAEf,IAAI,CAAC,CAAD,CAJyB;AAKnCgB,UAAAA,OAAO,EAAEhB,IAAI,CAAC,CAAD,CALsB;AAMnCiB,UAAAA,KAAK,EAAE;AAAER,YAAAA,QAAF;AAAYD,YAAAA,OAAZ;AAAqBF,YAAAA;AAArB,WAN4B;AAOnCR,UAAAA,KAAK,EAAEE,IAAI,CAAC,CAAD;AAPwB,SAArC;AASD,OAxBM,CAAP;AAyBD,KA1BD;AA2BD,GAnCD;AAoCD","sourcesContent":["import { RequestContext } from \"@graphql-box/core\";\nimport { CACHE_ENTRY_ADDED } from \"../../consts\";\n\nexport default function logCacheEntry() {\n return (\n _target: any,\n _propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<any>>,\n ): void => {\n const method = descriptor.value;\n if (!method) return;\n\n descriptor.value = async function descriptorValue(...args: any[]): Promise<any> {\n return new Promise<void>(async resolve => {\n const { debugManager, ...otherContext } = args[5] as RequestContext;\n\n if (!debugManager) {\n await method.apply(this, args);\n resolve();\n return;\n }\n\n const startTime = debugManager.now();\n await method.apply(this, args);\n const endTime = debugManager.now();\n const duration = endTime - startTime;\n resolve();\n\n debugManager.emit(CACHE_ENTRY_ADDED, {\n cachemapOptions: args[3],\n cacheType: args[0],\n context: otherContext,\n hash: args[1],\n options: args[4],\n stats: { duration, endTime, startTime },\n value: args[2],\n });\n });\n };\n };\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/debug/log-cache-entry/index.ts"],"names":["logCacheEntry","_target","_propertyName","descriptor","method","value","descriptorValue","args","Promise","resolve","debugManager","requestFieldCacheKey","requestID","otherContext","apply","startTime","now","endTime","duration","payload","cachemapOptions","cacheType","context","hash","options","stats","decryptedCacheKey","emit","CACHE_ENTRY_ADDED"],"mappings":";;;;;;;;;AAAA;;AAEe,SAASA,aAAT,GAAyB;AACtC,SAAO,CACLC,OADK,EAELC,aAFK,EAGLC,UAHK,KAII;AACT,UAAMC,MAAM,GAAGD,UAAU,CAACE,KAA1B;AACA,QAAI,CAACD,MAAL,EAAa;;AAEbD,IAAAA,UAAU,CAACE,KAAX,GAAmB,eAAeC,eAAf,CAA+B,GAAGC,IAAlC,EAA6D;AAC9E,aAAO,IAAIC,OAAJ,CAAkB,MAAMC,OAAN,IAAiB;AACxC,cAAM;AAAEC,UAAAA,YAAF;AAAgBC,UAAAA,oBAAhB;AAAsCC,UAAAA,SAAtC;AAAiD,aAAGC;AAApD,YAAqEN,IAAI,CAAC,CAAD,CAA/E;;AAIA,YAAI,CAACG,YAAL,EAAmB;AACjB,gBAAMN,MAAM,CAACU,KAAP,CAAa,IAAb,EAAmBP,IAAnB,CAAN;AACAE,UAAAA,OAAO;AACP;AACD;;AAED,cAAMM,SAAS,GAAGL,YAAY,CAACM,GAAb,EAAlB;AACA,cAAMZ,MAAM,CAACU,KAAP,CAAa,IAAb,EAAmBP,IAAnB,CAAN;AACA,cAAMU,OAAO,GAAGP,YAAY,CAACM,GAAb,EAAhB;AACA,cAAME,QAAQ,GAAGD,OAAO,GAAGF,SAA3B;AACAN,QAAAA,OAAO;AAEP,cAAMU,OAAO,GAAG;AACdC,UAAAA,eAAe,EAAEb,IAAI,CAAC,CAAD,CADP;AAEdc,UAAAA,SAAS,EAAEd,IAAI,CAAC,CAAD,CAFD;AAGde,UAAAA,OAAO,EAAET,YAHK;AAIdU,UAAAA,IAAI,EAAEhB,IAAI,CAAC,CAAD,CAJI;AAKdiB,UAAAA,OAAO,EAAEjB,IAAI,CAAC,CAAD,CALC;AAMdK,UAAAA,SANc;AAOda,UAAAA,KAAK,EAAE;AAAEP,YAAAA,QAAF;AAAYD,YAAAA,OAAZ;AAAqBF,YAAAA;AAArB,WAPO;AAQdV,UAAAA,KAAK,EAAEE,IAAI,CAAC,CAAD,CARG;AASd,cAAII,oBAAoB,GAAG;AAAEe,YAAAA,iBAAiB,EAAEf;AAArB,WAAH,GAAiD,EAAzE;AATc,SAAhB;AAYAD,QAAAA,YAAY,CAACiB,IAAb,CAAkBC,uBAAlB,EAAqCT,OAArC;AACD,OA9BM,CAAP;AA+BD,KAhCD;AAiCD,GAzCD;AA0CD","sourcesContent":["import { CACHE_ENTRY_ADDED, RequestContext } from \"@graphql-box/core\";\n\nexport default function logCacheEntry() {\n return (\n _target: any,\n _propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<any>>,\n ): void => {\n const method = descriptor.value;\n if (!method) return;\n\n descriptor.value = async function descriptorValue(...args: any[]): Promise<any> {\n return new Promise<void>(async resolve => {\n const { debugManager, requestFieldCacheKey, requestID, ...otherContext } = args[5] as RequestContext & {\n requestFieldCacheKey?: string;\n };\n\n if (!debugManager) {\n await method.apply(this, args);\n resolve();\n return;\n }\n\n const startTime = debugManager.now();\n await method.apply(this, args);\n const endTime = debugManager.now();\n const duration = endTime - startTime;\n resolve();\n\n const payload = {\n cachemapOptions: args[3],\n cacheType: args[0],\n context: otherContext,\n hash: args[1],\n options: args[4],\n requestID,\n stats: { duration, endTime, startTime },\n value: args[2],\n ...(requestFieldCacheKey ? { decryptedCacheKey: requestFieldCacheKey } : {}),\n };\n\n debugManager.emit(CACHE_ENTRY_ADDED, payload);\n });\n };\n };\n}\n"],"file":"index.js"}
@@ -7,7 +7,7 @@ exports.default = logCacheQuery;
7
7
 
8
8
  require("core-js/modules/es.promise.js");
9
9
 
10
- var _consts = require("../../consts");
10
+ var _core = require("@graphql-box/core");
11
11
 
12
12
  function logCacheQuery() {
13
13
  return (_target, _propertyName, descriptor) => {
@@ -19,6 +19,8 @@ function logCacheQuery() {
19
19
  return new Promise(async resolve => {
20
20
  const {
21
21
  debugManager,
22
+ requestFieldCacheKey,
23
+ requestID,
22
24
  ...otherContext
23
25
  } = args[3];
24
26
 
@@ -32,18 +34,23 @@ function logCacheQuery() {
32
34
  const endTime = debugManager.now();
33
35
  const duration = endTime - startTime;
34
36
  resolve(result);
35
- debugManager.emit(_consts.CACHE_ENTRY_QUERIED, {
37
+ const payload = {
36
38
  cacheType: args[0],
37
39
  context: otherContext,
38
40
  hash: args[1],
39
41
  options: args[2],
42
+ requestID,
40
43
  result,
41
44
  stats: {
42
45
  duration,
43
46
  endTime,
44
47
  startTime
45
- }
46
- });
48
+ },
49
+ ...(requestFieldCacheKey ? {
50
+ decryptedCacheKey: requestFieldCacheKey
51
+ } : {})
52
+ };
53
+ debugManager.emit(_core.CACHE_ENTRY_QUERIED, payload);
47
54
  });
48
55
  } catch (error) {
49
56
  return Promise.reject(error);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/debug/log-cache-query/index.ts"],"names":["logCacheQuery","_target","_propertyName","descriptor","method","value","descriptorValue","args","Promise","resolve","debugManager","otherContext","apply","startTime","now","result","endTime","duration","emit","CACHE_ENTRY_QUERIED","cacheType","context","hash","options","stats","error","reject"],"mappings":";;;;;;;;;AACA;;AAEe,SAASA,aAAT,GAAyB;AACtC,SAAO,CACLC,OADK,EAELC,aAFK,EAGLC,UAHK,KAII;AACT,UAAMC,MAAM,GAAGD,UAAU,CAACE,KAA1B;AACA,QAAI,CAACD,MAAL,EAAa;;AAEbD,IAAAA,UAAU,CAACE,KAAX,GAAmB,eAAeC,eAAf,CAA+B,GAAGC,IAAlC,EAA6D;AAC9E,UAAI;AACF,eAAO,IAAIC,OAAJ,CAAY,MAAMC,OAAN,IAAiB;AAClC,gBAAM;AAAEC,YAAAA,YAAF;AAAgB,eAAGC;AAAnB,cAAoCJ,IAAI,CAAC,CAAD,CAA9C;;AAEA,cAAI,CAACG,YAAL,EAAmB;AACjBD,YAAAA,OAAO,CAAC,MAAML,MAAM,CAACQ,KAAP,CAAa,IAAb,EAAmBL,IAAnB,CAAP,CAAP;AACA;AACD;;AAED,gBAAMM,SAAS,GAAGH,YAAY,CAACI,GAAb,EAAlB;AACA,gBAAMC,MAAM,GAAG,MAAMX,MAAM,CAACQ,KAAP,CAAa,IAAb,EAAmBL,IAAnB,CAArB;AACA,gBAAMS,OAAO,GAAGN,YAAY,CAACI,GAAb,EAAhB;AACA,gBAAMG,QAAQ,GAAGD,OAAO,GAAGH,SAA3B;AACAJ,UAAAA,OAAO,CAACM,MAAD,CAAP;AAEAL,UAAAA,YAAY,CAACQ,IAAb,CAAkBC,2BAAlB,EAAuC;AACrCC,YAAAA,SAAS,EAAEb,IAAI,CAAC,CAAD,CADsB;AAErCc,YAAAA,OAAO,EAAEV,YAF4B;AAGrCW,YAAAA,IAAI,EAAEf,IAAI,CAAC,CAAD,CAH2B;AAIrCgB,YAAAA,OAAO,EAAEhB,IAAI,CAAC,CAAD,CAJwB;AAKrCQ,YAAAA,MALqC;AAMrCS,YAAAA,KAAK,EAAE;AAAEP,cAAAA,QAAF;AAAYD,cAAAA,OAAZ;AAAqBH,cAAAA;AAArB;AAN8B,WAAvC;AAQD,SAtBM,CAAP;AAuBD,OAxBD,CAwBE,OAAOY,KAAP,EAAc;AACd,eAAOjB,OAAO,CAACkB,MAAR,CAAeD,KAAf,CAAP;AACD;AACF,KA5BD;AA6BD,GArCD;AAsCD","sourcesContent":["import { RequestContext } from \"@graphql-box/core\";\nimport { CACHE_ENTRY_QUERIED } from \"../../consts\";\n\nexport default function logCacheQuery() {\n return (\n _target: any,\n _propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<any>>,\n ): void => {\n const method = descriptor.value;\n if (!method) return;\n\n descriptor.value = async function descriptorValue(...args: any[]): Promise<any> {\n try {\n return new Promise(async resolve => {\n const { debugManager, ...otherContext } = args[3] as RequestContext;\n\n if (!debugManager) {\n resolve(await method.apply(this, args));\n return;\n }\n\n const startTime = debugManager.now();\n const result = await method.apply(this, args);\n const endTime = debugManager.now();\n const duration = endTime - startTime;\n resolve(result);\n\n debugManager.emit(CACHE_ENTRY_QUERIED, {\n cacheType: args[0],\n context: otherContext,\n hash: args[1],\n options: args[2],\n result,\n stats: { duration, endTime, startTime },\n });\n });\n } catch (error) {\n return Promise.reject(error);\n }\n };\n };\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/debug/log-cache-query/index.ts"],"names":["logCacheQuery","_target","_propertyName","descriptor","method","value","descriptorValue","args","Promise","resolve","debugManager","requestFieldCacheKey","requestID","otherContext","apply","startTime","now","result","endTime","duration","payload","cacheType","context","hash","options","stats","decryptedCacheKey","emit","CACHE_ENTRY_QUERIED","error","reject"],"mappings":";;;;;;;;;AAAA;;AAEe,SAASA,aAAT,GAAyB;AACtC,SAAO,CACLC,OADK,EAELC,aAFK,EAGLC,UAHK,KAII;AACT,UAAMC,MAAM,GAAGD,UAAU,CAACE,KAA1B;AACA,QAAI,CAACD,MAAL,EAAa;;AAEbD,IAAAA,UAAU,CAACE,KAAX,GAAmB,eAAeC,eAAf,CAA+B,GAAGC,IAAlC,EAA6D;AAC9E,UAAI;AACF,eAAO,IAAIC,OAAJ,CAAY,MAAMC,OAAN,IAAiB;AAClC,gBAAM;AAAEC,YAAAA,YAAF;AAAgBC,YAAAA,oBAAhB;AAAsCC,YAAAA,SAAtC;AAAiD,eAAGC;AAApD,cAAqEN,IAAI,CAAC,CAAD,CAA/E;;AAIA,cAAI,CAACG,YAAL,EAAmB;AACjBD,YAAAA,OAAO,CAAC,MAAML,MAAM,CAACU,KAAP,CAAa,IAAb,EAAmBP,IAAnB,CAAP,CAAP;AACA;AACD;;AAED,gBAAMQ,SAAS,GAAGL,YAAY,CAACM,GAAb,EAAlB;AACA,gBAAMC,MAAM,GAAG,MAAMb,MAAM,CAACU,KAAP,CAAa,IAAb,EAAmBP,IAAnB,CAArB;AACA,gBAAMW,OAAO,GAAGR,YAAY,CAACM,GAAb,EAAhB;AACA,gBAAMG,QAAQ,GAAGD,OAAO,GAAGH,SAA3B;AACAN,UAAAA,OAAO,CAACQ,MAAD,CAAP;AAEA,gBAAMG,OAAO,GAAG;AACdC,YAAAA,SAAS,EAAEd,IAAI,CAAC,CAAD,CADD;AAEde,YAAAA,OAAO,EAAET,YAFK;AAGdU,YAAAA,IAAI,EAAEhB,IAAI,CAAC,CAAD,CAHI;AAIdiB,YAAAA,OAAO,EAAEjB,IAAI,CAAC,CAAD,CAJC;AAKdK,YAAAA,SALc;AAMdK,YAAAA,MANc;AAOdQ,YAAAA,KAAK,EAAE;AAAEN,cAAAA,QAAF;AAAYD,cAAAA,OAAZ;AAAqBH,cAAAA;AAArB,aAPO;AAQd,gBAAIJ,oBAAoB,GAAG;AAAEe,cAAAA,iBAAiB,EAAEf;AAArB,aAAH,GAAiD,EAAzE;AARc,WAAhB;AAWAD,UAAAA,YAAY,CAACiB,IAAb,CAAkBC,yBAAlB,EAAuCR,OAAvC;AACD,SA5BM,CAAP;AA6BD,OA9BD,CA8BE,OAAOS,KAAP,EAAc;AACd,eAAOrB,OAAO,CAACsB,MAAR,CAAeD,KAAf,CAAP;AACD;AACF,KAlCD;AAmCD,GA3CD;AA4CD","sourcesContent":["import { CACHE_ENTRY_QUERIED, RequestContext } from \"@graphql-box/core\";\n\nexport default function logCacheQuery() {\n return (\n _target: any,\n _propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<any>>,\n ): void => {\n const method = descriptor.value;\n if (!method) return;\n\n descriptor.value = async function descriptorValue(...args: any[]): Promise<any> {\n try {\n return new Promise(async resolve => {\n const { debugManager, requestFieldCacheKey, requestID, ...otherContext } = args[3] as RequestContext & {\n requestFieldCacheKey?: string;\n };\n\n if (!debugManager) {\n resolve(await method.apply(this, args));\n return;\n }\n\n const startTime = debugManager.now();\n const result = await method.apply(this, args);\n const endTime = debugManager.now();\n const duration = endTime - startTime;\n resolve(result);\n\n const payload = {\n cacheType: args[0],\n context: otherContext,\n hash: args[1],\n options: args[2],\n requestID,\n result,\n stats: { duration, endTime, startTime },\n ...(requestFieldCacheKey ? { decryptedCacheKey: requestFieldCacheKey } : {}),\n };\n\n debugManager.emit(CACHE_ENTRY_QUERIED, payload);\n });\n } catch (error) {\n return Promise.reject(error);\n }\n };\n };\n}\n"],"file":"index.js"}
@@ -7,7 +7,7 @@ exports.default = logPartialCompiled;
7
7
 
8
8
  require("core-js/modules/es.promise.js");
9
9
 
10
- var _consts = require("../../consts");
10
+ var _core = require("@graphql-box/core");
11
11
 
12
12
  function logPartialCompiled() {
13
13
  return (_target, _propertyName, descriptor) => {
@@ -18,6 +18,7 @@ function logPartialCompiled() {
18
18
  return new Promise(async resolve => {
19
19
  const {
20
20
  debugManager,
21
+ requestID,
21
22
  ...otherContext
22
23
  } = args[3];
23
24
 
@@ -32,11 +33,12 @@ function logPartialCompiled() {
32
33
  const endTime = debugManager.now();
33
34
  const duration = endTime - startTime;
34
35
  resolve();
35
- debugManager.emit(_consts.PARTIAL_QUERY_COMPILED, {
36
+ debugManager.emit(_core.PARTIAL_QUERY_COMPILED, {
36
37
  context: otherContext,
37
38
  hash: args[0],
38
39
  options: args[2],
39
40
  partialQueryResponse: args[1],
41
+ requestID,
40
42
  stats: {
41
43
  duration,
42
44
  endTime,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/debug/log-partial-compiled/index.ts"],"names":["logPartialCompiled","_target","_propertyName","descriptor","method","value","descriptorValue","args","Promise","resolve","debugManager","otherContext","apply","startTime","now","endTime","duration","emit","PARTIAL_QUERY_COMPILED","context","hash","options","partialQueryResponse","stats"],"mappings":";;;;;;;;;AACA;;AAEe,SAASA,kBAAT,GAA8B;AAC3C,SAAO,CACLC,OADK,EAELC,aAFK,EAGLC,UAHK,KAII;AACT,UAAMC,MAAM,GAAGD,UAAU,CAACE,KAA1B;AACA,QAAI,CAACD,MAAL,EAAa;;AAEbD,IAAAA,UAAU,CAACE,KAAX,GAAmB,eAAeC,eAAf,CAA+B,GAAGC,IAAlC,EAA6D;AAC9E,aAAO,IAAIC,OAAJ,CAAkB,MAAMC,OAAN,IAAiB;AACxC,cAAM;AAAEC,UAAAA,YAAF;AAAgB,aAAGC;AAAnB,YAAoCJ,IAAI,CAAC,CAAD,CAA9C;;AAEA,YAAI,CAACG,YAAL,EAAmB;AACjB,gBAAMN,MAAM,CAACQ,KAAP,CAAa,IAAb,EAAmBL,IAAnB,CAAN;AACAE,UAAAA,OAAO;AACP;AACD;;AAED,cAAMI,SAAS,GAAGH,YAAY,CAACI,GAAb,EAAlB;AACA,cAAMV,MAAM,CAACQ,KAAP,CAAa,IAAb,EAAmBL,IAAnB,CAAN;AACA,cAAMQ,OAAO,GAAGL,YAAY,CAACI,GAAb,EAAhB;AACA,cAAME,QAAQ,GAAGD,OAAO,GAAGF,SAA3B;AACAJ,QAAAA,OAAO;AAEPC,QAAAA,YAAY,CAACO,IAAb,CAAkBC,8BAAlB,EAA0C;AACxCC,UAAAA,OAAO,EAAER,YAD+B;AAExCS,UAAAA,IAAI,EAAEb,IAAI,CAAC,CAAD,CAF8B;AAGxCc,UAAAA,OAAO,EAAEd,IAAI,CAAC,CAAD,CAH2B;AAIxCe,UAAAA,oBAAoB,EAAEf,IAAI,CAAC,CAAD,CAJc;AAKxCgB,UAAAA,KAAK,EAAE;AAAEP,YAAAA,QAAF;AAAYD,YAAAA,OAAZ;AAAqBF,YAAAA;AAArB;AALiC,SAA1C;AAOD,OAtBM,CAAP;AAuBD,KAxBD;AAyBD,GAjCD;AAkCD","sourcesContent":["import { RequestContext } from \"@graphql-box/core\";\nimport { PARTIAL_QUERY_COMPILED } from \"../../consts\";\n\nexport default function logPartialCompiled() {\n return (\n _target: any,\n _propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<any>>,\n ): void => {\n const method = descriptor.value;\n if (!method) return;\n\n descriptor.value = async function descriptorValue(...args: any[]): Promise<any> {\n return new Promise<void>(async resolve => {\n const { debugManager, ...otherContext } = args[3] as RequestContext;\n\n if (!debugManager) {\n await method.apply(this, args);\n resolve();\n return;\n }\n\n const startTime = debugManager.now();\n await method.apply(this, args);\n const endTime = debugManager.now();\n const duration = endTime - startTime;\n resolve();\n\n debugManager.emit(PARTIAL_QUERY_COMPILED, {\n context: otherContext,\n hash: args[0],\n options: args[2],\n partialQueryResponse: args[1],\n stats: { duration, endTime, startTime },\n });\n });\n };\n };\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/debug/log-partial-compiled/index.ts"],"names":["logPartialCompiled","_target","_propertyName","descriptor","method","value","descriptorValue","args","Promise","resolve","debugManager","requestID","otherContext","apply","startTime","now","endTime","duration","emit","PARTIAL_QUERY_COMPILED","context","hash","options","partialQueryResponse","stats"],"mappings":";;;;;;;;;AAAA;;AAEe,SAASA,kBAAT,GAA8B;AAC3C,SAAO,CACLC,OADK,EAELC,aAFK,EAGLC,UAHK,KAII;AACT,UAAMC,MAAM,GAAGD,UAAU,CAACE,KAA1B;AACA,QAAI,CAACD,MAAL,EAAa;;AAEbD,IAAAA,UAAU,CAACE,KAAX,GAAmB,eAAeC,eAAf,CAA+B,GAAGC,IAAlC,EAA6D;AAC9E,aAAO,IAAIC,OAAJ,CAAkB,MAAMC,OAAN,IAAiB;AACxC,cAAM;AAAEC,UAAAA,YAAF;AAAgBC,UAAAA,SAAhB;AAA2B,aAAGC;AAA9B,YAA+CL,IAAI,CAAC,CAAD,CAAzD;;AAEA,YAAI,CAACG,YAAL,EAAmB;AACjB,gBAAMN,MAAM,CAACS,KAAP,CAAa,IAAb,EAAmBN,IAAnB,CAAN;AACAE,UAAAA,OAAO;AACP;AACD;;AAED,cAAMK,SAAS,GAAGJ,YAAY,CAACK,GAAb,EAAlB;AACA,cAAMX,MAAM,CAACS,KAAP,CAAa,IAAb,EAAmBN,IAAnB,CAAN;AACA,cAAMS,OAAO,GAAGN,YAAY,CAACK,GAAb,EAAhB;AACA,cAAME,QAAQ,GAAGD,OAAO,GAAGF,SAA3B;AACAL,QAAAA,OAAO;AAEPC,QAAAA,YAAY,CAACQ,IAAb,CAAkBC,4BAAlB,EAA0C;AACxCC,UAAAA,OAAO,EAAER,YAD+B;AAExCS,UAAAA,IAAI,EAAEd,IAAI,CAAC,CAAD,CAF8B;AAGxCe,UAAAA,OAAO,EAAEf,IAAI,CAAC,CAAD,CAH2B;AAIxCgB,UAAAA,oBAAoB,EAAEhB,IAAI,CAAC,CAAD,CAJc;AAKxCI,UAAAA,SALwC;AAMxCa,UAAAA,KAAK,EAAE;AAAEP,YAAAA,QAAF;AAAYD,YAAAA,OAAZ;AAAqBF,YAAAA;AAArB;AANiC,SAA1C;AAQD,OAvBM,CAAP;AAwBD,KAzBD;AA0BD,GAlCD;AAmCD","sourcesContent":["import { PARTIAL_QUERY_COMPILED, RequestContext } from \"@graphql-box/core\";\n\nexport default function logPartialCompiled() {\n return (\n _target: any,\n _propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<any>>,\n ): void => {\n const method = descriptor.value;\n if (!method) return;\n\n descriptor.value = async function descriptorValue(...args: any[]): Promise<any> {\n return new Promise<void>(async resolve => {\n const { debugManager, requestID, ...otherContext } = args[3] as RequestContext;\n\n if (!debugManager) {\n await method.apply(this, args);\n resolve();\n return;\n }\n\n const startTime = debugManager.now();\n await method.apply(this, args);\n const endTime = debugManager.now();\n const duration = endTime - startTime;\n resolve();\n\n debugManager.emit(PARTIAL_QUERY_COMPILED, {\n context: otherContext,\n hash: args[0],\n options: args[2],\n partialQueryResponse: args[1],\n requestID,\n stats: { duration, endTime, startTime },\n });\n });\n };\n };\n}\n"],"file":"index.js"}
package/lib/main/index.js CHANGED
@@ -4,29 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
- CACHE_ENTRY_ADDED: true,
8
- CACHE_ENTRY_QUERIED: true,
9
- PARTIAL_QUERY_COMPILED: true,
10
7
  CacheManager: true
11
8
  };
12
- Object.defineProperty(exports, "CACHE_ENTRY_ADDED", {
13
- enumerable: true,
14
- get: function () {
15
- return _consts.CACHE_ENTRY_ADDED;
16
- }
17
- });
18
- Object.defineProperty(exports, "CACHE_ENTRY_QUERIED", {
19
- enumerable: true,
20
- get: function () {
21
- return _consts.CACHE_ENTRY_QUERIED;
22
- }
23
- });
24
- Object.defineProperty(exports, "PARTIAL_QUERY_COMPILED", {
25
- enumerable: true,
26
- get: function () {
27
- return _consts.PARTIAL_QUERY_COMPILED;
28
- }
29
- });
30
9
  Object.defineProperty(exports, "default", {
31
10
  enumerable: true,
32
11
  get: function () {
@@ -40,8 +19,6 @@ Object.defineProperty(exports, "CacheManager", {
40
19
  }
41
20
  });
42
21
 
43
- var _consts = require("./consts");
44
-
45
22
  var _defs = require("./defs");
46
23
 
47
24
  Object.keys(_defs).forEach(function (key) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA","sourcesContent":["export { CACHE_ENTRY_ADDED, CACHE_ENTRY_QUERIED, PARTIAL_QUERY_COMPILED } from \"./consts\";\nexport * from \"./defs\";\nexport { default, CacheManager } from \"./main\";\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA","sourcesContent":["export * from \"./defs\";\nexport { default, CacheManager } from \"./main\";\n"],"file":"index.js"}
@@ -368,6 +368,7 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
368
368
  const {
369
369
  hashedRequestFieldCacheKey,
370
370
  propNameOrIndex,
371
+ requestFieldCacheKey,
371
372
  requestFieldPath
372
373
  } = keysAndPaths;
373
374
  const fieldTypeInfo = context.fieldTypeMap.get(requestFieldPath);
@@ -389,7 +390,7 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
389
390
  const {
390
391
  cacheability,
391
392
  entry
392
- } = await this._retrieveCachedRequestFieldPathData(hashedRequestFieldCacheKey, options, context);
393
+ } = await this._retrieveCachedRequestFieldPathData(hashedRequestFieldCacheKey, requestFieldCacheKey, options, context);
393
394
 
394
395
  CacheManager._setCachedResponseData({
395
396
  cacheability,
@@ -742,7 +743,8 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
742
743
  requestFieldPathData: ancestorRequestFieldPathData
743
744
  }, {
744
745
  hashedRequestFieldCacheKey,
745
- propNameOrIndex
746
+ propNameOrIndex,
747
+ requestFieldCacheKey
746
748
  }, fieldTypeInfo, options, context) {
747
749
  var _entityData;
748
750
 
@@ -756,7 +758,7 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
756
758
  const {
757
759
  cacheability: entryCacheability,
758
760
  entry
759
- } = await this._retrieveCachedRequestFieldPathData(hashedRequestFieldCacheKey, options, context);
761
+ } = await this._retrieveCachedRequestFieldPathData(hashedRequestFieldCacheKey, requestFieldCacheKey, options, context);
760
762
 
761
763
  if (entry) {
762
764
  requestFieldPathData = this._mergeObjects(requestFieldPathData, entry);
@@ -795,8 +797,10 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
795
797
  };
796
798
  }
797
799
 
798
- async _retrieveCachedRequestFieldPathData(hash, options, context) {
799
- return this._checkCacheEntry(_core.REQUEST_FIELD_PATHS, hash, options, context) || {};
800
+ async _retrieveCachedRequestFieldPathData(hash, requestFieldCacheKey, options, context) {
801
+ return this._checkCacheEntry(_core.REQUEST_FIELD_PATHS, hash, options, { ...context,
802
+ requestFieldCacheKey
803
+ }) || {};
800
804
  }
801
805
 
802
806
  async _retrieveCachedResponseData({
@@ -828,9 +832,9 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
828
832
  }
829
833
 
830
834
  _retrieveResponseDataForCaching(normalizedResponseData, context) {
831
- const responseChunks = this._responseChunksAwaitingCaching.get(context.boxID);
835
+ const responseChunks = this._responseChunksAwaitingCaching.get(context.requestID);
832
836
 
833
- this._responseChunksAwaitingCaching.delete(context.boxID);
837
+ this._responseChunksAwaitingCaching.delete(context.requestID);
834
838
 
835
839
  return (0, _mergeResponseDataSets.default)([...responseChunks, normalizedResponseData]);
836
840
  }
@@ -1018,6 +1022,7 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
1018
1022
  }, options, context) {
1019
1023
  const {
1020
1024
  hashedRequestFieldCacheKey,
1025
+ requestFieldCacheKey,
1021
1026
  responseDataPath
1022
1027
  } = keysAndPaths;
1023
1028
  let fieldData = (0, _get2.default)(data, responseDataPath);
@@ -1033,7 +1038,9 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
1033
1038
  fieldData = (0, _filterOutPropsWithArgsOrDirectives.default)(fieldData, field.selectionSet.selections, keysAndPaths, context);
1034
1039
  }
1035
1040
 
1036
- const result = await this._checkCacheEntry(_core.REQUEST_FIELD_PATHS, hashedRequestFieldCacheKey, options, context);
1041
+ const result = await this._checkCacheEntry(_core.REQUEST_FIELD_PATHS, hashedRequestFieldCacheKey, options, { ...context,
1042
+ requestFieldCacheKey
1043
+ });
1037
1044
 
1038
1045
  if (result && (0, _isObjectLike2.default)(fieldData)) {
1039
1046
  fieldData = this._mergeObjects(result.entry, fieldData);
@@ -1044,7 +1051,9 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
1044
1051
  cacheControl: cacheability.printCacheControl()
1045
1052
  },
1046
1053
  tag: options.tag
1047
- }, options, context);
1054
+ }, options, { ...context,
1055
+ requestFieldCacheKey
1056
+ });
1048
1057
 
1049
1058
  if ((0, _helpers.hasChildFields)(field, {
1050
1059
  fragmentDefinitions: context.fragmentDefinitions
@@ -1061,12 +1070,12 @@ let CacheManager = (_dec = (0, _debug.logCacheQuery)(), _dec2 = (0, _debug.logCa
1061
1070
  }
1062
1071
 
1063
1072
  _setResponseChunksAwaitingCaching(normalizedResponseData, context) {
1064
- const responseChunks = this._responseChunksAwaitingCaching.get(context.boxID);
1073
+ const responseChunks = this._responseChunksAwaitingCaching.get(context.requestID);
1065
1074
 
1066
1075
  if (responseChunks) {
1067
- this._responseChunksAwaitingCaching.set(context.boxID, [...responseChunks, normalizedResponseData]);
1076
+ this._responseChunksAwaitingCaching.set(context.requestID, [...responseChunks, normalizedResponseData]);
1068
1077
  } else {
1069
- this._responseChunksAwaitingCaching.set(context.boxID, [normalizedResponseData]);
1078
+ this._responseChunksAwaitingCaching.set(context.requestID, [normalizedResponseData]);
1070
1079
  }
1071
1080
  }
1072
1081