@graphql-box/cache-manager 5.2.3 → 5.2.4
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/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/production.analysis.txt +93 -93
- package/dist/types/cjs/debug/logCacheEntry.d.cts +1 -1
- package/dist/types/cjs/debug/logCacheEntry.d.cts.map +1 -1
- package/dist/types/cjs/debug/logCacheQuery.d.cts +1 -1
- package/dist/types/cjs/debug/logCacheQuery.d.cts.map +1 -1
- package/dist/types/cjs/debug/logPartialCompiled.d.cts +1 -1
- package/dist/types/cjs/debug/logPartialCompiled.d.cts.map +1 -1
- package/dist/types/cjs/helpers/areOnlyPopulatedFieldsTypeIdKeys.d.cts +1 -1
- package/dist/types/cjs/helpers/areOnlyPopulatedFieldsTypeIdKeys.d.cts.map +1 -1
- package/dist/types/cjs/main.d.cts.map +1 -1
- package/dist/types/esm/debug/logCacheEntry.d.ts +1 -1
- package/dist/types/esm/debug/logCacheEntry.d.ts.map +1 -1
- package/dist/types/esm/debug/logCacheQuery.d.ts +1 -1
- package/dist/types/esm/debug/logCacheQuery.d.ts.map +1 -1
- package/dist/types/esm/debug/logPartialCompiled.d.ts +1 -1
- package/dist/types/esm/debug/logPartialCompiled.d.ts.map +1 -1
- package/dist/types/esm/helpers/areOnlyPopulatedFieldsTypeIdKeys.d.ts +1 -1
- package/dist/types/esm/helpers/areOnlyPopulatedFieldsTypeIdKeys.d.ts.map +1 -1
- package/dist/types/esm/main.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/debug/logCacheEntry.ts +1 -1
- package/src/debug/logCacheQuery.ts +1 -1
- package/src/debug/logPartialCompiled.ts +1 -1
- package/src/helpers/areOnlyPopulatedFieldsTypeIdKeys.ts +1 -1
- package/src/index.test.ts +10 -0
- package/src/main.ts +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-box/cache-manager",
|
|
3
3
|
"description": "The GraphQL Box cache manager module.",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.4",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/graphql-box",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@cachemap/types": "^5.0.6",
|
|
33
33
|
"cacheability": "^4.0.20",
|
|
34
34
|
"@graphql-box/core": "5.2.3",
|
|
35
|
-
"@graphql-box/helpers": "5.2.
|
|
35
|
+
"@graphql-box/helpers": "5.2.4"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@babel/runtime": "<8",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"del-cli": "^5.1.0",
|
|
53
53
|
"graphql": "^16.8.1",
|
|
54
54
|
"lodash-es": "^4.17.21",
|
|
55
|
-
"@graphql-box/test-utils": "5.2.
|
|
55
|
+
"@graphql-box/test-utils": "5.2.4"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"client",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CACHE_ENTRY_ADDED, type CacheTypes, type CachemapOptions, type RequestOptions } from '@graphql-box/core';
|
|
2
|
-
import type
|
|
2
|
+
import { type CacheManagerContext, type CacheManagerDef } from '../types.ts';
|
|
3
3
|
|
|
4
4
|
type Descriptor = (
|
|
5
5
|
cacheType: CacheTypes,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CACHE_ENTRY_QUERIED, type CacheTypes, type RequestOptions } from '@graphql-box/core';
|
|
2
|
-
import type
|
|
2
|
+
import { type CacheManagerContext, type CacheManagerDef } from '../types.ts';
|
|
3
3
|
|
|
4
4
|
type Descriptor = (
|
|
5
5
|
cacheType: CacheTypes,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PARTIAL_QUERY_COMPILED, type RequestOptions } from '@graphql-box/core';
|
|
2
|
-
import type
|
|
2
|
+
import { type CacheManagerContext, type CacheManagerDef, type PartialQueryResponse } from '../types.ts';
|
|
3
3
|
|
|
4
4
|
type Descriptor = (
|
|
5
5
|
hash: string,
|
package/src/index.test.ts
CHANGED
|
@@ -862,6 +862,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
862
862
|
});
|
|
863
863
|
|
|
864
864
|
it('correct request data', () => {
|
|
865
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
865
866
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
866
867
|
expect(otherProps).toMatchSnapshot();
|
|
867
868
|
});
|
|
@@ -892,6 +893,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
892
893
|
});
|
|
893
894
|
|
|
894
895
|
it('correct request data', () => {
|
|
896
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
895
897
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
896
898
|
expect(otherProps).toMatchSnapshot();
|
|
897
899
|
});
|
|
@@ -922,6 +924,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
922
924
|
});
|
|
923
925
|
|
|
924
926
|
it('correct request data', () => {
|
|
927
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
925
928
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
926
929
|
expect(otherProps).toMatchSnapshot();
|
|
927
930
|
});
|
|
@@ -952,6 +955,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
952
955
|
});
|
|
953
956
|
|
|
954
957
|
it('correct request data', () => {
|
|
958
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
955
959
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
956
960
|
expect(otherProps).toMatchSnapshot();
|
|
957
961
|
});
|
|
@@ -1211,6 +1215,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
1211
1215
|
});
|
|
1212
1216
|
|
|
1213
1217
|
it('correct request data', () => {
|
|
1218
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1214
1219
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
1215
1220
|
expect(otherProps).toMatchSnapshot();
|
|
1216
1221
|
});
|
|
@@ -1265,6 +1270,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
1265
1270
|
});
|
|
1266
1271
|
|
|
1267
1272
|
it('correct request data', () => {
|
|
1273
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1268
1274
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
1269
1275
|
expect(otherProps).toMatchSnapshot();
|
|
1270
1276
|
});
|
|
@@ -1322,6 +1328,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
1322
1328
|
});
|
|
1323
1329
|
|
|
1324
1330
|
it('correct request data', () => {
|
|
1331
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1325
1332
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
1326
1333
|
expect(otherProps).toMatchSnapshot();
|
|
1327
1334
|
});
|
|
@@ -1377,6 +1384,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
1377
1384
|
});
|
|
1378
1385
|
|
|
1379
1386
|
it('correct request data', () => {
|
|
1387
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1380
1388
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
1381
1389
|
expect(otherProps).toMatchSnapshot();
|
|
1382
1390
|
});
|
|
@@ -1429,6 +1437,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
1429
1437
|
});
|
|
1430
1438
|
|
|
1431
1439
|
it('correct request data', () => {
|
|
1440
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1432
1441
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
1433
1442
|
expect(otherProps).toMatchSnapshot();
|
|
1434
1443
|
});
|
|
@@ -1481,6 +1490,7 @@ describe('@graphql-box/cache-manager >>', () => {
|
|
|
1481
1490
|
});
|
|
1482
1491
|
|
|
1483
1492
|
it('correct request data', () => {
|
|
1493
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1484
1494
|
const { ast, ...otherProps } = analyzeQueryResult!.updated!;
|
|
1485
1495
|
expect(otherProps).toMatchSnapshot();
|
|
1486
1496
|
});
|
package/src/main.ts
CHANGED
|
@@ -287,6 +287,7 @@ export class CacheManager implements CacheManagerDef {
|
|
|
287
287
|
|
|
288
288
|
const filteredAST = filterQuery(requestData, cachedResponseData, cacheManagerContext);
|
|
289
289
|
const filteredRequest = print(filteredAST);
|
|
290
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
290
291
|
const { fragmentDefinitions, typeIDKey, ...rest } = cacheManagerContext;
|
|
291
292
|
assign(context, { ...rest, filteredRequest });
|
|
292
293
|
this._setPartialQueryResponse(hash, { cacheMetadata, data }, options, context);
|