@graphql-box/connection-resolver 5.4.7 → 5.4.9
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 +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/production.analysis.txt +18 -18
- package/dist/types/cjs/main/index.d.cts.map +1 -1
- package/dist/types/cjs/types.d.cts +2 -3
- package/dist/types/cjs/types.d.cts.map +1 -1
- package/dist/types/esm/main/index.d.ts.map +1 -1
- package/dist/types/esm/types.d.ts +2 -3
- package/dist/types/esm/types.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/main/index.test.ts +10 -10
- package/src/main/index.ts +2 -3
- package/src/types.ts +2 -3
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@graphql-box/connection-resolver",
|
3
3
|
"description": "The GraphQL Box connection resolver module.",
|
4
|
-
"version": "5.4.
|
4
|
+
"version": "5.4.9",
|
5
5
|
"author": "Dylan Aubrey",
|
6
6
|
"license": "MIT",
|
7
7
|
"homepage": "https://github.com/badbatch/graphql-box",
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"js-base64": "^3.7.7",
|
39
39
|
"lodash-es": "^4.17.21",
|
40
40
|
"type-fest": "^4.30.0",
|
41
|
-
"@graphql-box/core": "5.4.
|
41
|
+
"@graphql-box/core": "5.4.4"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
44
|
"graphql": "<17",
|
package/src/main/index.test.ts
CHANGED
@@ -7,7 +7,7 @@ import { encode } from 'js-base64';
|
|
7
7
|
import { generateCursorCache } from '../__testUtils__/generateCursorCache.ts';
|
8
8
|
import { generatePageResponse } from '../__testUtils__/generatePageResponse.ts';
|
9
9
|
import { removeConnectionInputOptions } from '../helpers/removeConnectionInputOptions.ts';
|
10
|
-
import { type Getters, type Node, type ResourceResponse } from '../types.ts';
|
10
|
+
import { type Context, type Getters, type Node, type ResourceResponse } from '../types.ts';
|
11
11
|
import { makeConnectionResolver } from './index.ts';
|
12
12
|
|
13
13
|
const createMakeCursors = (_source: PlainObject, args: PlainObject) => ({
|
@@ -49,7 +49,7 @@ describe('connectionResolver', () => {
|
|
49
49
|
|
50
50
|
const args = { before: 'abcdefg', first: 5, query: 'Hello world!' };
|
51
51
|
const info = {};
|
52
|
-
result = await connectionResolver({}, args, {}, info as GraphQLResolveInfo);
|
52
|
+
result = await connectionResolver({}, args, {} as Context, info as GraphQLResolveInfo);
|
53
53
|
});
|
54
54
|
|
55
55
|
it('should return the correct result', () => {
|
@@ -104,7 +104,7 @@ describe('connectionResolver', () => {
|
|
104
104
|
};
|
105
105
|
|
106
106
|
const info = {};
|
107
|
-
result = await connectionResolver({}, args, {}, info as GraphQLResolveInfo);
|
107
|
+
result = await connectionResolver({}, args, {} as Context, info as GraphQLResolveInfo);
|
108
108
|
});
|
109
109
|
|
110
110
|
it('should return the correct result', () => {
|
@@ -151,7 +151,7 @@ describe('connectionResolver', () => {
|
|
151
151
|
};
|
152
152
|
|
153
153
|
const info = {};
|
154
|
-
result = await connectionResolver({}, args, {}, info as GraphQLResolveInfo);
|
154
|
+
result = await connectionResolver({}, args, {} as Context, info as GraphQLResolveInfo);
|
155
155
|
});
|
156
156
|
|
157
157
|
it('should return the correct result', () => {
|
@@ -202,7 +202,7 @@ describe('connectionResolver', () => {
|
|
202
202
|
};
|
203
203
|
|
204
204
|
const info = {};
|
205
|
-
result = await connectionResolver({}, args, {}, info as GraphQLResolveInfo);
|
205
|
+
result = await connectionResolver({}, args, {} as Context, info as GraphQLResolveInfo);
|
206
206
|
});
|
207
207
|
|
208
208
|
it('should return the correct result', () => {
|
@@ -248,7 +248,7 @@ describe('connectionResolver', () => {
|
|
248
248
|
};
|
249
249
|
|
250
250
|
const info = {};
|
251
|
-
result = await connectionResolver({}, args, {}, info as GraphQLResolveInfo);
|
251
|
+
result = await connectionResolver({}, args, {} as Context, info as GraphQLResolveInfo);
|
252
252
|
});
|
253
253
|
|
254
254
|
it('should return the correct result', () => {
|
@@ -298,7 +298,7 @@ describe('connectionResolver', () => {
|
|
298
298
|
};
|
299
299
|
|
300
300
|
const info = {};
|
301
|
-
result = await connectionResolver({}, args, {}, info as GraphQLResolveInfo);
|
301
|
+
result = await connectionResolver({}, args, {} as Context, info as GraphQLResolveInfo);
|
302
302
|
});
|
303
303
|
|
304
304
|
it('should return the correct result', () => {
|
@@ -349,7 +349,7 @@ describe('connectionResolver', () => {
|
|
349
349
|
};
|
350
350
|
|
351
351
|
const info = {};
|
352
|
-
result = await connectionResolver({}, args, {}, info as GraphQLResolveInfo);
|
352
|
+
result = await connectionResolver({}, args, {} as Context, info as GraphQLResolveInfo);
|
353
353
|
});
|
354
354
|
|
355
355
|
it('should return the correct result', () => {
|
@@ -395,7 +395,7 @@ describe('connectionResolver', () => {
|
|
395
395
|
};
|
396
396
|
|
397
397
|
const info = {};
|
398
|
-
result = await connectionResolver({}, args, {}, info as GraphQLResolveInfo);
|
398
|
+
result = await connectionResolver({}, args, {} as Context, info as GraphQLResolveInfo);
|
399
399
|
});
|
400
400
|
|
401
401
|
it('should return the correct result', () => {
|
@@ -445,7 +445,7 @@ describe('connectionResolver', () => {
|
|
445
445
|
};
|
446
446
|
|
447
447
|
const info = {};
|
448
|
-
result = await connectionResolver({}, args, {}, info as GraphQLResolveInfo);
|
448
|
+
result = await connectionResolver({}, args, {} as Context, info as GraphQLResolveInfo);
|
449
449
|
});
|
450
450
|
|
451
451
|
it('should return the correct result', () => {
|
package/src/main/index.ts
CHANGED
@@ -36,15 +36,14 @@ export const makeConnectionResolver =
|
|
36
36
|
const { makeGroupCursor, makeIDCursor } = createMakeCursors(source, args, context, info);
|
37
37
|
const resourceResolver = createResourceResolver(source, args, context, info);
|
38
38
|
const groupCursor = makeGroupCursor();
|
39
|
-
const {
|
39
|
+
const { data: ctxData, logger, setCacheMetadata } = context;
|
40
40
|
const { fieldName: fieldPath } = info;
|
41
41
|
|
42
42
|
const childLogger = logger?.child({
|
43
|
+
...ctxData,
|
43
44
|
args,
|
44
45
|
fieldPath,
|
45
46
|
groupCursor,
|
46
|
-
operationName,
|
47
|
-
requestID,
|
48
47
|
});
|
49
48
|
|
50
49
|
childLogger?.info(`Resolving ${fieldPath}`);
|
package/src/types.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type Core } from '@cachemap/core';
|
2
|
-
import { type PlainObject } from '@graphql-box/core';
|
2
|
+
import { type ExecutionContextValue, type PlainObject } from '@graphql-box/core';
|
3
3
|
import { type GraphQLResolveInfo, type OperationTypeNode } from 'graphql';
|
4
4
|
import { type SetOptional } from 'type-fest';
|
5
5
|
import { type Logger } from 'winston';
|
@@ -64,9 +64,8 @@ export type ResourceResolver<Resource extends PlainObject> = (args: {
|
|
64
64
|
|
65
65
|
export type SetCacheMetadata = (key: string, headers: Headers, operation?: OperationTypeNode) => void;
|
66
66
|
|
67
|
-
export type Context =
|
67
|
+
export type Context = ExecutionContextValue & {
|
68
68
|
logger?: Logger;
|
69
|
-
setCacheMetadata?: SetCacheMetadata;
|
70
69
|
};
|
71
70
|
|
72
71
|
export type CreateResourceResolver<
|