graphql-http 1.8.0 → 1.10.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/README.md +0 -1
- package/lib/audits/common.d.mts +3 -3
- package/lib/audits/common.d.ts +3 -3
- package/lib/audits/server.d.mts +1 -1
- package/lib/audits/server.d.ts +1 -1
- package/lib/audits/server.js +37 -3
- package/lib/audits/server.mjs +37 -3
- package/lib/handler.d.mts +17 -8
- package/lib/handler.d.ts +17 -8
- package/lib/handler.js +4 -1
- package/lib/handler.mjs +4 -1
- package/package.json +30 -27
- package/umd/graphql-http.min.js.gz +0 -0
package/README.md
CHANGED
|
@@ -735,7 +735,6 @@ If you want a feature-full server with bleeding edge technologies, you're recomm
|
|
|
735
735
|
| [hotchocolate](https://chillicream.com/docs/hotchocolate) | [✅ Compliant](/implementations/hotchocolate/README.md) |
|
|
736
736
|
| [postgraphile](https://www.graphile.org/postgraphile/) | [✅ Compliant](/implementations/postgraphile/README.md) |
|
|
737
737
|
| [apollo-server](https://www.apollographql.com/docs/apollo-server/) | [✅ Compliant](/implementations/apollo-server/README.md) |
|
|
738
|
-
| [mercurius](https://mercurius.dev) | [✅ Compliant](/implementations/mercurius/README.md) |
|
|
739
738
|
|
|
740
739
|
## [Documentation](docs/)
|
|
741
740
|
|
package/lib/audits/common.d.mts
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @category Audits
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type AuditRequirement = 'MUST' | 'SHOULD' | 'MAY';
|
|
12
12
|
/**
|
|
13
13
|
* Audit name starting with the audit requirement level.
|
|
14
14
|
*
|
|
15
15
|
* @category Audits
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type AuditName = `${AuditRequirement} ${string}`;
|
|
18
18
|
/**
|
|
19
19
|
* Actual audit test returning an result.
|
|
20
20
|
*
|
|
@@ -55,4 +55,4 @@ export interface AuditFail {
|
|
|
55
55
|
*
|
|
56
56
|
* @category Audits
|
|
57
57
|
*/
|
|
58
|
-
export
|
|
58
|
+
export type AuditResult = AuditOk | AuditFail;
|
package/lib/audits/common.d.ts
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @category Audits
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type AuditRequirement = 'MUST' | 'SHOULD' | 'MAY';
|
|
12
12
|
/**
|
|
13
13
|
* Audit name starting with the audit requirement level.
|
|
14
14
|
*
|
|
15
15
|
* @category Audits
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type AuditName = `${AuditRequirement} ${string}`;
|
|
18
18
|
/**
|
|
19
19
|
* Actual audit test returning an result.
|
|
20
20
|
*
|
|
@@ -55,4 +55,4 @@ export interface AuditFail {
|
|
|
55
55
|
*
|
|
56
56
|
* @category Audits
|
|
57
57
|
*/
|
|
58
|
-
export
|
|
58
|
+
export type AuditResult = AuditOk | AuditFail;
|
package/lib/audits/server.d.mts
CHANGED
|
@@ -16,7 +16,7 @@ export interface ServerAuditOptions {
|
|
|
16
16
|
* A function can be also supplied, in this case -
|
|
17
17
|
* every audit will invoke the function to get the URL.
|
|
18
18
|
*/
|
|
19
|
-
url: string | (() => string | Promise<string>);
|
|
19
|
+
url: string | Promise<string> | (() => string | Promise<string>);
|
|
20
20
|
/**
|
|
21
21
|
* The Fetch function to use.
|
|
22
22
|
*
|
package/lib/audits/server.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface ServerAuditOptions {
|
|
|
16
16
|
* A function can be also supplied, in this case -
|
|
17
17
|
* every audit will invoke the function to get the URL.
|
|
18
18
|
*/
|
|
19
|
-
url: string | (() => string | Promise<string>);
|
|
19
|
+
url: string | Promise<string> | (() => string | Promise<string>);
|
|
20
20
|
/**
|
|
21
21
|
* The Fetch function to use.
|
|
22
22
|
*
|
package/lib/audits/server.js
CHANGED
|
@@ -313,6 +313,40 @@ function serverAudits(opts) {
|
|
|
313
313
|
(0, utils_1.assert)('Status code', res.status).toBe(200);
|
|
314
314
|
(0, utils_1.assert)('Execution result', await (0, utils_1.assertBodyAsExecutionResult)(res)).notToHaveProperty('errors');
|
|
315
315
|
}),
|
|
316
|
+
...['variables', 'operationName', 'extensions'].flatMap((parameter) => [
|
|
317
|
+
(0, utils_1.audit)(
|
|
318
|
+
// TODO: convert to MUST after watershed
|
|
319
|
+
`SHOULD allow null {${parameter}} parameter when accepting application/graphql-response+json`, async () => {
|
|
320
|
+
const res = await fetchFn(await getUrl(opts.url), {
|
|
321
|
+
method: 'POST',
|
|
322
|
+
headers: {
|
|
323
|
+
'content-type': 'application/json',
|
|
324
|
+
accept: 'application/graphql-response+json',
|
|
325
|
+
},
|
|
326
|
+
body: JSON.stringify({
|
|
327
|
+
query: '{ __typename }',
|
|
328
|
+
[parameter]: null,
|
|
329
|
+
}),
|
|
330
|
+
});
|
|
331
|
+
(0, utils_1.assert)('Status code', res.status).toBe(200);
|
|
332
|
+
(0, utils_1.assert)('Execution result', await (0, utils_1.assertBodyAsExecutionResult)(res)).notToHaveProperty('errors');
|
|
333
|
+
}),
|
|
334
|
+
(0, utils_1.audit)(`MUST allow null {${parameter}} parameter when accepting application/json`, async () => {
|
|
335
|
+
const res = await fetchFn(await getUrl(opts.url), {
|
|
336
|
+
method: 'POST',
|
|
337
|
+
headers: {
|
|
338
|
+
'content-type': 'application/json',
|
|
339
|
+
accept: 'application/json',
|
|
340
|
+
},
|
|
341
|
+
body: JSON.stringify({
|
|
342
|
+
query: '{ __typename }',
|
|
343
|
+
[parameter]: null,
|
|
344
|
+
}),
|
|
345
|
+
});
|
|
346
|
+
(0, utils_1.assert)('Status code', res.status).toBe(200);
|
|
347
|
+
(0, utils_1.assert)('Execution result', await (0, utils_1.assertBodyAsExecutionResult)(res)).notToHaveProperty('errors');
|
|
348
|
+
}),
|
|
349
|
+
]),
|
|
316
350
|
...['string', 0, false, ['array']].map((invalid) => (0, utils_1.audit)(
|
|
317
351
|
// TODO: convert to MUST after watershed
|
|
318
352
|
`SHOULD use 400 status code on ${(0, utils_1.extendedTypeof)(invalid)} {variables} parameter when accepting application/graphql-response+json`, async () => {
|
|
@@ -694,8 +728,8 @@ async function auditServer(opts) {
|
|
|
694
728
|
exports.auditServer = auditServer;
|
|
695
729
|
/** @private */
|
|
696
730
|
async function getUrl(url) {
|
|
697
|
-
if (typeof url === '
|
|
698
|
-
return url;
|
|
731
|
+
if (typeof url === 'function') {
|
|
732
|
+
return await url();
|
|
699
733
|
}
|
|
700
|
-
return
|
|
734
|
+
return url;
|
|
701
735
|
}
|
package/lib/audits/server.mjs
CHANGED
|
@@ -310,6 +310,40 @@ export function serverAudits(opts) {
|
|
|
310
310
|
assert('Status code', res.status).toBe(200);
|
|
311
311
|
assert('Execution result', await assertBodyAsExecutionResult(res)).notToHaveProperty('errors');
|
|
312
312
|
}),
|
|
313
|
+
...['variables', 'operationName', 'extensions'].flatMap((parameter) => [
|
|
314
|
+
audit(
|
|
315
|
+
// TODO: convert to MUST after watershed
|
|
316
|
+
`SHOULD allow null {${parameter}} parameter when accepting application/graphql-response+json`, async () => {
|
|
317
|
+
const res = await fetchFn(await getUrl(opts.url), {
|
|
318
|
+
method: 'POST',
|
|
319
|
+
headers: {
|
|
320
|
+
'content-type': 'application/json',
|
|
321
|
+
accept: 'application/graphql-response+json',
|
|
322
|
+
},
|
|
323
|
+
body: JSON.stringify({
|
|
324
|
+
query: '{ __typename }',
|
|
325
|
+
[parameter]: null,
|
|
326
|
+
}),
|
|
327
|
+
});
|
|
328
|
+
assert('Status code', res.status).toBe(200);
|
|
329
|
+
assert('Execution result', await assertBodyAsExecutionResult(res)).notToHaveProperty('errors');
|
|
330
|
+
}),
|
|
331
|
+
audit(`MUST allow null {${parameter}} parameter when accepting application/json`, async () => {
|
|
332
|
+
const res = await fetchFn(await getUrl(opts.url), {
|
|
333
|
+
method: 'POST',
|
|
334
|
+
headers: {
|
|
335
|
+
'content-type': 'application/json',
|
|
336
|
+
accept: 'application/json',
|
|
337
|
+
},
|
|
338
|
+
body: JSON.stringify({
|
|
339
|
+
query: '{ __typename }',
|
|
340
|
+
[parameter]: null,
|
|
341
|
+
}),
|
|
342
|
+
});
|
|
343
|
+
assert('Status code', res.status).toBe(200);
|
|
344
|
+
assert('Execution result', await assertBodyAsExecutionResult(res)).notToHaveProperty('errors');
|
|
345
|
+
}),
|
|
346
|
+
]),
|
|
313
347
|
...['string', 0, false, ['array']].map((invalid) => audit(
|
|
314
348
|
// TODO: convert to MUST after watershed
|
|
315
349
|
`SHOULD use 400 status code on ${extendedTypeof(invalid)} {variables} parameter when accepting application/graphql-response+json`, async () => {
|
|
@@ -689,8 +723,8 @@ export async function auditServer(opts) {
|
|
|
689
723
|
}
|
|
690
724
|
/** @private */
|
|
691
725
|
async function getUrl(url) {
|
|
692
|
-
if (typeof url === '
|
|
693
|
-
return url;
|
|
726
|
+
if (typeof url === 'function') {
|
|
727
|
+
return await url();
|
|
694
728
|
}
|
|
695
|
-
return
|
|
729
|
+
return url;
|
|
696
730
|
}
|
package/lib/handler.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ import { RequestParams } from './common';
|
|
|
10
10
|
*
|
|
11
11
|
* @category Server
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type RequestHeaders = {
|
|
14
14
|
/**
|
|
15
15
|
* Always an array in Node. Duplicates are added to it.
|
|
16
16
|
* Not necessarily true for other environments.
|
|
@@ -54,7 +54,7 @@ export interface Request<Raw, Context> {
|
|
|
54
54
|
*
|
|
55
55
|
* @category Server
|
|
56
56
|
*/
|
|
57
|
-
export
|
|
57
|
+
export type ResponseHeaders = {
|
|
58
58
|
accept?: string;
|
|
59
59
|
allow?: string;
|
|
60
60
|
'content-type'?: string;
|
|
@@ -65,7 +65,7 @@ export declare type ResponseHeaders = {
|
|
|
65
65
|
*
|
|
66
66
|
* @category Server
|
|
67
67
|
*/
|
|
68
|
-
export
|
|
68
|
+
export type ResponseBody = string;
|
|
69
69
|
/**
|
|
70
70
|
* Server agnostic response options (ex. status and headers) returned from
|
|
71
71
|
* `graphql-http` needing to be coerced to the server implementation in use.
|
|
@@ -83,7 +83,7 @@ export interface ResponseInit {
|
|
|
83
83
|
*
|
|
84
84
|
* @category Server
|
|
85
85
|
*/
|
|
86
|
-
export
|
|
86
|
+
export type Response = readonly [body: ResponseBody | null, init: ResponseInit];
|
|
87
87
|
/**
|
|
88
88
|
* Checks whether the passed value is the `graphql-http` server agnostic response.
|
|
89
89
|
*
|
|
@@ -100,9 +100,9 @@ export declare function isResponse(val: unknown): val is Response;
|
|
|
100
100
|
*
|
|
101
101
|
* @category Server
|
|
102
102
|
*/
|
|
103
|
-
export
|
|
103
|
+
export type OperationContext = Record<PropertyKey, unknown> | symbol | number | string | boolean | undefined | null;
|
|
104
104
|
/** @category Server */
|
|
105
|
-
export
|
|
105
|
+
export type OperationArgs<Context extends OperationContext = undefined> = ExecutionArgs & {
|
|
106
106
|
contextValue?: Context;
|
|
107
107
|
};
|
|
108
108
|
/** @category Server */
|
|
@@ -150,6 +150,15 @@ export interface HandlerOptions<RequestRaw = unknown, RequestContext = unknown,
|
|
|
150
150
|
* GraphQL operation AST getter used for detecting the operation type.
|
|
151
151
|
*/
|
|
152
152
|
getOperationAST?: typeof graphqlGetOperationAST;
|
|
153
|
+
/**
|
|
154
|
+
* The GraphQL root value or resolvers to go alongside the execution.
|
|
155
|
+
* Learn more about them here: https://graphql.org/learn/execution/#root-fields-resolvers.
|
|
156
|
+
*
|
|
157
|
+
* If you return from `onSubscribe`, and the returned value is
|
|
158
|
+
* missing the `rootValue` field, the relevant operation root
|
|
159
|
+
* will be used instead.
|
|
160
|
+
*/
|
|
161
|
+
rootValue?: unknown;
|
|
153
162
|
/**
|
|
154
163
|
* The subscribe callback executed right after processing the request
|
|
155
164
|
* before proceeding with the GraphQL operation execution.
|
|
@@ -204,7 +213,7 @@ export interface HandlerOptions<RequestRaw = unknown, RequestContext = unknown,
|
|
|
204
213
|
*
|
|
205
214
|
* @category Server
|
|
206
215
|
*/
|
|
207
|
-
export
|
|
216
|
+
export type Handler<RequestRaw = unknown, RequestContext = unknown> = (req: Request<RequestRaw, RequestContext>) => Promise<Response>;
|
|
208
217
|
/**
|
|
209
218
|
* Makes a GraphQL over HTTP Protocol compliant server handler. The handler can
|
|
210
219
|
* be used with your favourite server library.
|
|
@@ -266,7 +275,7 @@ export declare function createHandler<RequestRaw = unknown, RequestContext = unk
|
|
|
266
275
|
*
|
|
267
276
|
* @category Server
|
|
268
277
|
*/
|
|
269
|
-
export
|
|
278
|
+
export type AcceptableMediaType = 'application/graphql-response+json' | 'application/json';
|
|
270
279
|
/**
|
|
271
280
|
* Inspects the request and detects the appropriate/acceptable Media-Type
|
|
272
281
|
* looking at the `Accept` header while complying with the GraphQL over HTTP Protocol.
|
package/lib/handler.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { RequestParams } from './common';
|
|
|
10
10
|
*
|
|
11
11
|
* @category Server
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type RequestHeaders = {
|
|
14
14
|
/**
|
|
15
15
|
* Always an array in Node. Duplicates are added to it.
|
|
16
16
|
* Not necessarily true for other environments.
|
|
@@ -54,7 +54,7 @@ export interface Request<Raw, Context> {
|
|
|
54
54
|
*
|
|
55
55
|
* @category Server
|
|
56
56
|
*/
|
|
57
|
-
export
|
|
57
|
+
export type ResponseHeaders = {
|
|
58
58
|
accept?: string;
|
|
59
59
|
allow?: string;
|
|
60
60
|
'content-type'?: string;
|
|
@@ -65,7 +65,7 @@ export declare type ResponseHeaders = {
|
|
|
65
65
|
*
|
|
66
66
|
* @category Server
|
|
67
67
|
*/
|
|
68
|
-
export
|
|
68
|
+
export type ResponseBody = string;
|
|
69
69
|
/**
|
|
70
70
|
* Server agnostic response options (ex. status and headers) returned from
|
|
71
71
|
* `graphql-http` needing to be coerced to the server implementation in use.
|
|
@@ -83,7 +83,7 @@ export interface ResponseInit {
|
|
|
83
83
|
*
|
|
84
84
|
* @category Server
|
|
85
85
|
*/
|
|
86
|
-
export
|
|
86
|
+
export type Response = readonly [body: ResponseBody | null, init: ResponseInit];
|
|
87
87
|
/**
|
|
88
88
|
* Checks whether the passed value is the `graphql-http` server agnostic response.
|
|
89
89
|
*
|
|
@@ -100,9 +100,9 @@ export declare function isResponse(val: unknown): val is Response;
|
|
|
100
100
|
*
|
|
101
101
|
* @category Server
|
|
102
102
|
*/
|
|
103
|
-
export
|
|
103
|
+
export type OperationContext = Record<PropertyKey, unknown> | symbol | number | string | boolean | undefined | null;
|
|
104
104
|
/** @category Server */
|
|
105
|
-
export
|
|
105
|
+
export type OperationArgs<Context extends OperationContext = undefined> = ExecutionArgs & {
|
|
106
106
|
contextValue?: Context;
|
|
107
107
|
};
|
|
108
108
|
/** @category Server */
|
|
@@ -150,6 +150,15 @@ export interface HandlerOptions<RequestRaw = unknown, RequestContext = unknown,
|
|
|
150
150
|
* GraphQL operation AST getter used for detecting the operation type.
|
|
151
151
|
*/
|
|
152
152
|
getOperationAST?: typeof graphqlGetOperationAST;
|
|
153
|
+
/**
|
|
154
|
+
* The GraphQL root value or resolvers to go alongside the execution.
|
|
155
|
+
* Learn more about them here: https://graphql.org/learn/execution/#root-fields-resolvers.
|
|
156
|
+
*
|
|
157
|
+
* If you return from `onSubscribe`, and the returned value is
|
|
158
|
+
* missing the `rootValue` field, the relevant operation root
|
|
159
|
+
* will be used instead.
|
|
160
|
+
*/
|
|
161
|
+
rootValue?: unknown;
|
|
153
162
|
/**
|
|
154
163
|
* The subscribe callback executed right after processing the request
|
|
155
164
|
* before proceeding with the GraphQL operation execution.
|
|
@@ -204,7 +213,7 @@ export interface HandlerOptions<RequestRaw = unknown, RequestContext = unknown,
|
|
|
204
213
|
*
|
|
205
214
|
* @category Server
|
|
206
215
|
*/
|
|
207
|
-
export
|
|
216
|
+
export type Handler<RequestRaw = unknown, RequestContext = unknown> = (req: Request<RequestRaw, RequestContext>) => Promise<Response>;
|
|
208
217
|
/**
|
|
209
218
|
* Makes a GraphQL over HTTP Protocol compliant server handler. The handler can
|
|
210
219
|
* be used with your favourite server library.
|
|
@@ -266,7 +275,7 @@ export declare function createHandler<RequestRaw = unknown, RequestContext = unk
|
|
|
266
275
|
*
|
|
267
276
|
* @category Server
|
|
268
277
|
*/
|
|
269
|
-
export
|
|
278
|
+
export type AcceptableMediaType = 'application/graphql-response+json' | 'application/json';
|
|
270
279
|
/**
|
|
271
280
|
* Inspects the request and detects the appropriate/acceptable Media-Type
|
|
272
281
|
* looking at the `Accept` header while complying with the GraphQL over HTTP Protocol.
|
package/lib/handler.js
CHANGED
|
@@ -76,7 +76,7 @@ exports.isResponse = isResponse;
|
|
|
76
76
|
* @category Server
|
|
77
77
|
*/
|
|
78
78
|
function createHandler(options) {
|
|
79
|
-
const { schema, context, validate = graphql_1.validate, execute = graphql_1.execute, parse = graphql_1.parse, getOperationAST = graphql_1.getOperationAST, onSubscribe, onOperation, } = options;
|
|
79
|
+
const { schema, context, validate = graphql_1.validate, execute = graphql_1.execute, parse = graphql_1.parse, getOperationAST = graphql_1.getOperationAST, rootValue, onSubscribe, onOperation, } = options;
|
|
80
80
|
return async function handler(req) {
|
|
81
81
|
var _a, _b;
|
|
82
82
|
const method = req.method;
|
|
@@ -260,6 +260,9 @@ function createHandler(options) {
|
|
|
260
260
|
},
|
|
261
261
|
];
|
|
262
262
|
}
|
|
263
|
+
if (!('rootValue' in args)) {
|
|
264
|
+
args.rootValue = rootValue;
|
|
265
|
+
}
|
|
263
266
|
if (!('contextValue' in args)) {
|
|
264
267
|
const resOrContext = typeof context === 'function' ? await context(req, params) : context;
|
|
265
268
|
if (isResponse(resOrContext))
|
package/lib/handler.mjs
CHANGED
|
@@ -72,7 +72,7 @@ export function isResponse(val) {
|
|
|
72
72
|
* @category Server
|
|
73
73
|
*/
|
|
74
74
|
export function createHandler(options) {
|
|
75
|
-
const { schema, context, validate = graphqlValidate, execute = graphqlExecute, parse = graphqlParse, getOperationAST = graphqlGetOperationAST, onSubscribe, onOperation, } = options;
|
|
75
|
+
const { schema, context, validate = graphqlValidate, execute = graphqlExecute, parse = graphqlParse, getOperationAST = graphqlGetOperationAST, rootValue, onSubscribe, onOperation, } = options;
|
|
76
76
|
return async function handler(req) {
|
|
77
77
|
var _a, _b;
|
|
78
78
|
const method = req.method;
|
|
@@ -256,6 +256,9 @@ export function createHandler(options) {
|
|
|
256
256
|
},
|
|
257
257
|
];
|
|
258
258
|
}
|
|
259
|
+
if (!('rootValue' in args)) {
|
|
260
|
+
args.rootValue = rootValue;
|
|
261
|
+
}
|
|
259
262
|
if (!('contextValue' in args)) {
|
|
260
263
|
const resOrContext = typeof context === 'function' ? await context(req, params) : context;
|
|
261
264
|
if (isResponse(resOrContext))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphql-http",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Simple, pluggable, zero-dependency, GraphQL over HTTP Protocol compliant server and client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=12"
|
|
26
26
|
},
|
|
27
|
-
"packageManager": "yarn@3.
|
|
27
|
+
"packageManager": "yarn@3.3.1",
|
|
28
28
|
"main": "lib/index.js",
|
|
29
29
|
"module": "lib/index.mjs",
|
|
30
30
|
"browser": "umd/graphql-http.js",
|
|
@@ -72,12 +72,14 @@
|
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"gendocs": "typedoc --options typedoc.js src/",
|
|
75
|
-
"lint": "eslint 'src'",
|
|
75
|
+
"lint:eslint": "eslint 'src'",
|
|
76
|
+
"lint:prettier": "prettier -c .",
|
|
77
|
+
"lint": "yarn lint:eslint && yarn lint:prettier",
|
|
76
78
|
"type-check": "tsc --noEmit",
|
|
77
79
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
78
80
|
"build:esm": "tsc -b tsconfig.esm.json && node scripts/esm-post-process.mjs",
|
|
79
81
|
"build:cjs": "tsc -b tsconfig.cjs.json",
|
|
80
|
-
"build:umd": "rollup
|
|
82
|
+
"build:umd": "rollup --bundleConfigAsCjs --config rollup.config.ts --configPlugin typescript && gzip umd/graphql-http.min.js -c > umd/graphql-http.min.js.gz",
|
|
81
83
|
"build": "yarn build:esm && yarn build:cjs && yarn build:umd",
|
|
82
84
|
"release": "semantic-release"
|
|
83
85
|
},
|
|
@@ -88,39 +90,40 @@
|
|
|
88
90
|
"graphql": ">=0.11 <=16"
|
|
89
91
|
},
|
|
90
92
|
"devDependencies": {
|
|
91
|
-
"@babel/core": "^7.20.
|
|
93
|
+
"@babel/core": "^7.20.7",
|
|
92
94
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
93
95
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
94
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.20.
|
|
95
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
96
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
97
|
+
"@babel/plugin-proposal-optional-chaining": "^7.20.7",
|
|
96
98
|
"@babel/preset-env": "^7.20.2",
|
|
97
99
|
"@babel/preset-typescript": "^7.18.6",
|
|
98
|
-
"@rollup/plugin-
|
|
99
|
-
"@
|
|
100
|
+
"@rollup/plugin-terser": "^0.2.1",
|
|
101
|
+
"@rollup/plugin-typescript": "^10.0.1",
|
|
102
|
+
"@semantic-release/changelog": "^6.0.2",
|
|
100
103
|
"@semantic-release/git": "^10.0.1",
|
|
101
|
-
"@types/
|
|
102
|
-
"@types/
|
|
103
|
-
"@
|
|
104
|
-
"@
|
|
105
|
-
"@
|
|
106
|
-
"
|
|
107
|
-
"
|
|
104
|
+
"@types/eslint": "^8.4.10",
|
|
105
|
+
"@types/express": "^4.17.15",
|
|
106
|
+
"@types/glob": "^8.0.0",
|
|
107
|
+
"@types/jest": "^29.2.4",
|
|
108
|
+
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
|
109
|
+
"@typescript-eslint/parser": "^5.47.0",
|
|
110
|
+
"@whatwg-node/fetch": "^0.5.3",
|
|
111
|
+
"babel-jest": "^29.3.1",
|
|
112
|
+
"eslint": "^8.30.0",
|
|
108
113
|
"eslint-config-prettier": "^8.5.0",
|
|
109
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
110
114
|
"express": "^4.18.2",
|
|
111
|
-
"fastify": "^4.
|
|
115
|
+
"fastify": "^4.10.2",
|
|
112
116
|
"graphql": "^16.6.0",
|
|
113
|
-
"jest": "^29.3.
|
|
114
|
-
"jest-jasmine2": "^29.3.
|
|
115
|
-
"node-fetch": "^3.
|
|
116
|
-
"prettier": "^2.
|
|
117
|
-
"rollup": "^3.
|
|
118
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
117
|
+
"jest": "^29.3.1",
|
|
118
|
+
"jest-jasmine2": "^29.3.1",
|
|
119
|
+
"node-fetch": "^3.3.0",
|
|
120
|
+
"prettier": "^2.8.1",
|
|
121
|
+
"rollup": "^3.8.1",
|
|
119
122
|
"semantic-release": "^19.0.5",
|
|
120
123
|
"tslib": "^2.4.1",
|
|
121
|
-
"typedoc": "^0.23.
|
|
122
|
-
"typedoc-plugin-markdown": "^3.
|
|
123
|
-
"typescript": "^4.
|
|
124
|
+
"typedoc": "^0.23.23",
|
|
125
|
+
"typedoc-plugin-markdown": "^3.14.0",
|
|
126
|
+
"typescript": "^4.9.4"
|
|
124
127
|
},
|
|
125
128
|
"resolutions": {
|
|
126
129
|
"npm/libnpmversion": "^3.0.6"
|
|
Binary file
|