@graphql-tools/url-loader 7.15.0 → 7.16.0-alpha-20220909134330-9a789de9
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/cjs/index.js +75 -46
- package/cjs/utils.js +6 -1
- package/esm/index.js +76 -47
- package/esm/utils.js +5 -0
- package/package.json +2 -3
- package/typings/index.d.cts +8 -8
- package/typings/index.d.ts +8 -8
- package/typings/utils.d.cts +2 -0
- package/typings/utils.d.ts +2 -0
package/cjs/index.js
CHANGED
|
@@ -11,7 +11,6 @@ const graphql_ws_1 = require("graphql-ws");
|
|
|
11
11
|
const isomorphic_ws_1 = tslib_1.__importDefault(require("isomorphic-ws"));
|
|
12
12
|
const extract_files_1 = require("extract-files");
|
|
13
13
|
const value_or_promise_1 = require("value-or-promise");
|
|
14
|
-
const graphql_live_query_1 = require("@n1ru4l/graphql-live-query");
|
|
15
14
|
const defaultAsyncFetch_js_1 = require("./defaultAsyncFetch.js");
|
|
16
15
|
const defaultSyncFetch_js_1 = require("./defaultSyncFetch.js");
|
|
17
16
|
const handleMultipartMixedResponse_js_1 = require("./handleMultipartMixedResponse.js");
|
|
@@ -156,7 +155,7 @@ class UrlLoader {
|
|
|
156
155
|
ws: 'http',
|
|
157
156
|
});
|
|
158
157
|
const executor = (request) => {
|
|
159
|
-
var _a, _b
|
|
158
|
+
var _a, _b;
|
|
160
159
|
const controller = (0, addCancelToResponseStream_js_1.cancelNeeded)() ? new fetch_1.AbortController() : undefined;
|
|
161
160
|
let method = defaultMethod;
|
|
162
161
|
const operationAst = (0, utils_1.getOperationASTFromRequest)(request);
|
|
@@ -164,18 +163,15 @@ class UrlLoader {
|
|
|
164
163
|
if ((options === null || options === void 0 ? void 0 : options.useGETForQueries) && operationType === 'query') {
|
|
165
164
|
method = 'GET';
|
|
166
165
|
}
|
|
167
|
-
let accept = 'application/json';
|
|
168
|
-
if (operationType === 'subscription' || (0,
|
|
166
|
+
let accept = 'application/graphql-response+json, application/json, multipart/mixed';
|
|
167
|
+
if (operationType === 'subscription' || (0, utils_js_1.isLiveQueryOperationDefinitionNode)(operationAst)) {
|
|
169
168
|
method = 'GET';
|
|
170
169
|
accept = 'text/event-stream';
|
|
171
170
|
}
|
|
172
|
-
|
|
173
|
-
accept += ', multipart/mixed';
|
|
174
|
-
}
|
|
175
|
-
const endpoint = ((_b = request.extensions) === null || _b === void 0 ? void 0 : _b.endpoint) || HTTP_URL;
|
|
171
|
+
const endpoint = ((_a = request.extensions) === null || _a === void 0 ? void 0 : _a.endpoint) || HTTP_URL;
|
|
176
172
|
const headers = Object.assign({
|
|
177
173
|
accept,
|
|
178
|
-
}, options === null || options === void 0 ? void 0 : options.headers, ((
|
|
174
|
+
}, options === null || options === void 0 ? void 0 : options.headers, ((_b = request.extensions) === null || _b === void 0 ? void 0 : _b.headers) || {});
|
|
179
175
|
const query = (0, graphql_1.print)(request.document);
|
|
180
176
|
const requestBody = {
|
|
181
177
|
query,
|
|
@@ -205,32 +201,18 @@ class UrlLoader {
|
|
|
205
201
|
signal: controller === null || controller === void 0 ? void 0 : controller.signal,
|
|
206
202
|
}, request.context, request.info);
|
|
207
203
|
case 'POST':
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
headers
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
.resolve();
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
return fetch(endpoint, {
|
|
224
|
-
method: 'POST',
|
|
225
|
-
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
226
|
-
body: JSON.stringify(requestBody),
|
|
227
|
-
headers: {
|
|
228
|
-
'content-type': 'application/json',
|
|
229
|
-
...headers,
|
|
230
|
-
},
|
|
231
|
-
signal: controller === null || controller === void 0 ? void 0 : controller.signal,
|
|
232
|
-
}, request.context, request.info);
|
|
233
|
-
}
|
|
204
|
+
return new value_or_promise_1.ValueOrPromise(() => this.createFormDataFromVariables(requestBody))
|
|
205
|
+
.then(body => fetch(endpoint, {
|
|
206
|
+
method: 'POST',
|
|
207
|
+
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
208
|
+
body,
|
|
209
|
+
headers: {
|
|
210
|
+
...headers,
|
|
211
|
+
...(typeof body === 'string' ? { 'content-type': 'application/json' } : {}),
|
|
212
|
+
},
|
|
213
|
+
signal: controller === null || controller === void 0 ? void 0 : controller.signal,
|
|
214
|
+
}, request.context, request.info))
|
|
215
|
+
.resolve();
|
|
234
216
|
}
|
|
235
217
|
})
|
|
236
218
|
.then((fetchResult) => {
|
|
@@ -259,13 +241,66 @@ class UrlLoader {
|
|
|
259
241
|
else {
|
|
260
242
|
return result;
|
|
261
243
|
}
|
|
244
|
+
})
|
|
245
|
+
.catch((e) => {
|
|
246
|
+
if (typeof e === 'string') {
|
|
247
|
+
return {
|
|
248
|
+
errors: [
|
|
249
|
+
(0, utils_1.createGraphQLError)(e, {
|
|
250
|
+
extensions: {
|
|
251
|
+
requestBody,
|
|
252
|
+
},
|
|
253
|
+
}),
|
|
254
|
+
],
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
else if (e.name === 'GraphQLError') {
|
|
258
|
+
return {
|
|
259
|
+
errors: [e],
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
else if (e.name === 'TypeError' && e.message === 'fetch failed') {
|
|
263
|
+
return {
|
|
264
|
+
errors: [
|
|
265
|
+
(0, utils_1.createGraphQLError)(`fetch failed to ${endpoint}`, {
|
|
266
|
+
extensions: {
|
|
267
|
+
requestBody,
|
|
268
|
+
},
|
|
269
|
+
originalError: e,
|
|
270
|
+
}),
|
|
271
|
+
],
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
else if (e.message) {
|
|
275
|
+
return {
|
|
276
|
+
errors: [
|
|
277
|
+
(0, utils_1.createGraphQLError)(e.message, {
|
|
278
|
+
extensions: {
|
|
279
|
+
requestBody,
|
|
280
|
+
},
|
|
281
|
+
originalError: e,
|
|
282
|
+
}),
|
|
283
|
+
],
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
return {
|
|
288
|
+
errors: [
|
|
289
|
+
(0, utils_1.createGraphQLError)('Unknown error', {
|
|
290
|
+
extensions: {
|
|
291
|
+
requestBody,
|
|
292
|
+
},
|
|
293
|
+
originalError: e,
|
|
294
|
+
}),
|
|
295
|
+
],
|
|
296
|
+
};
|
|
297
|
+
}
|
|
262
298
|
})
|
|
263
299
|
.resolve();
|
|
264
300
|
};
|
|
265
301
|
if ((options === null || options === void 0 ? void 0 : options.retry) != null) {
|
|
266
302
|
return function retryExecutor(request) {
|
|
267
303
|
let result;
|
|
268
|
-
let error;
|
|
269
304
|
let attempt = 0;
|
|
270
305
|
function retryAttempt() {
|
|
271
306
|
attempt++;
|
|
@@ -273,10 +308,9 @@ class UrlLoader {
|
|
|
273
308
|
if (result != null) {
|
|
274
309
|
return result;
|
|
275
310
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
279
|
-
throw new Error('No result');
|
|
311
|
+
return {
|
|
312
|
+
errors: [(0, utils_1.createGraphQLError)('No response returned from fetch')],
|
|
313
|
+
};
|
|
280
314
|
}
|
|
281
315
|
return new value_or_promise_1.ValueOrPromise(() => executor(request))
|
|
282
316
|
.then(res => {
|
|
@@ -286,10 +320,6 @@ class UrlLoader {
|
|
|
286
320
|
return retryAttempt();
|
|
287
321
|
}
|
|
288
322
|
return result;
|
|
289
|
-
})
|
|
290
|
-
.catch((e) => {
|
|
291
|
-
error = e;
|
|
292
|
-
return retryAttempt();
|
|
293
323
|
})
|
|
294
324
|
.resolve();
|
|
295
325
|
}
|
|
@@ -503,8 +533,7 @@ class UrlLoader {
|
|
|
503
533
|
// eslint-disable-next-line no-inner-declarations
|
|
504
534
|
function getExecutorByRequest(request) {
|
|
505
535
|
const operationAst = (0, utils_1.getOperationASTFromRequest)(request);
|
|
506
|
-
if (operationAst.operation === 'subscription' ||
|
|
507
|
-
(0, graphql_live_query_1.isLiveQueryOperationDefinitionNode)(operationAst, request.variables)) {
|
|
536
|
+
if (operationAst.operation === 'subscription' || (0, utils_js_1.isLiveQueryOperationDefinitionNode)(operationAst)) {
|
|
508
537
|
return subscriptionExecutor$;
|
|
509
538
|
}
|
|
510
539
|
else {
|
package/cjs/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LEGACY_WS = exports.isPromiseLike = exports.isGraphQLUpload = exports.isBlob = void 0;
|
|
3
|
+
exports.LEGACY_WS = exports.isLiveQueryOperationDefinitionNode = exports.isPromiseLike = exports.isGraphQLUpload = exports.isBlob = void 0;
|
|
4
|
+
const utils_1 = require("@graphql-tools/utils");
|
|
4
5
|
function isBlob(obj) {
|
|
5
6
|
return typeof obj.arrayBuffer === 'function';
|
|
6
7
|
}
|
|
@@ -13,6 +14,10 @@ function isPromiseLike(obj) {
|
|
|
13
14
|
return typeof obj.then === 'function';
|
|
14
15
|
}
|
|
15
16
|
exports.isPromiseLike = isPromiseLike;
|
|
17
|
+
exports.isLiveQueryOperationDefinitionNode = (0, utils_1.memoize1)(function isLiveQueryOperationDefinitionNode(node) {
|
|
18
|
+
var _a;
|
|
19
|
+
return (_a = node.directives) === null || _a === void 0 ? void 0 : _a.some(directive => directive.name.value === 'live');
|
|
20
|
+
});
|
|
16
21
|
var LEGACY_WS;
|
|
17
22
|
(function (LEGACY_WS) {
|
|
18
23
|
LEGACY_WS["CONNECTION_INIT"] = "connection_init";
|
package/esm/index.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/* eslint-disable no-case-declarations */
|
|
2
2
|
/// <reference lib="dom" />
|
|
3
3
|
import { print, stripIgnoredCharacters, buildASTSchema, buildSchema, } from 'graphql';
|
|
4
|
-
import { observableToAsyncIterable, isAsyncIterable, parseGraphQLSDL, getOperationASTFromRequest, } from '@graphql-tools/utils';
|
|
4
|
+
import { observableToAsyncIterable, isAsyncIterable, parseGraphQLSDL, getOperationASTFromRequest, createGraphQLError, } from '@graphql-tools/utils';
|
|
5
5
|
import { introspectSchema, wrapSchema } from '@graphql-tools/wrap';
|
|
6
6
|
import { createClient } from 'graphql-ws';
|
|
7
7
|
import WebSocket from 'isomorphic-ws';
|
|
8
8
|
import { extractFiles, isExtractableFile } from 'extract-files';
|
|
9
9
|
import { ValueOrPromise } from 'value-or-promise';
|
|
10
|
-
import { isLiveQueryOperationDefinitionNode } from '@n1ru4l/graphql-live-query';
|
|
11
10
|
import { defaultAsyncFetch } from './defaultAsyncFetch.js';
|
|
12
11
|
import { defaultSyncFetch } from './defaultSyncFetch.js';
|
|
13
12
|
import { handleMultipartMixedResponse } from './handleMultipartMixedResponse.js';
|
|
14
13
|
import { handleEventStreamResponse } from './event-stream/handleEventStreamResponse.js';
|
|
15
14
|
import { cancelNeeded } from './event-stream/addCancelToResponseStream.js';
|
|
16
15
|
import { AbortController, FormData, File } from '@whatwg-node/fetch';
|
|
17
|
-
import { isBlob, isGraphQLUpload, isPromiseLike, LEGACY_WS } from './utils.js';
|
|
16
|
+
import { isBlob, isGraphQLUpload, isLiveQueryOperationDefinitionNode, isPromiseLike, LEGACY_WS } from './utils.js';
|
|
18
17
|
const asyncImport = (moduleName) => import(moduleName);
|
|
19
18
|
const syncImport = (moduleName) => require(moduleName);
|
|
20
19
|
export var SubscriptionProtocol;
|
|
@@ -152,7 +151,7 @@ export class UrlLoader {
|
|
|
152
151
|
ws: 'http',
|
|
153
152
|
});
|
|
154
153
|
const executor = (request) => {
|
|
155
|
-
var _a, _b
|
|
154
|
+
var _a, _b;
|
|
156
155
|
const controller = cancelNeeded() ? new AbortController() : undefined;
|
|
157
156
|
let method = defaultMethod;
|
|
158
157
|
const operationAst = getOperationASTFromRequest(request);
|
|
@@ -160,18 +159,15 @@ export class UrlLoader {
|
|
|
160
159
|
if ((options === null || options === void 0 ? void 0 : options.useGETForQueries) && operationType === 'query') {
|
|
161
160
|
method = 'GET';
|
|
162
161
|
}
|
|
163
|
-
let accept = 'application/json';
|
|
162
|
+
let accept = 'application/graphql-response+json, application/json, multipart/mixed';
|
|
164
163
|
if (operationType === 'subscription' || isLiveQueryOperationDefinitionNode(operationAst)) {
|
|
165
164
|
method = 'GET';
|
|
166
165
|
accept = 'text/event-stream';
|
|
167
166
|
}
|
|
168
|
-
|
|
169
|
-
accept += ', multipart/mixed';
|
|
170
|
-
}
|
|
171
|
-
const endpoint = ((_b = request.extensions) === null || _b === void 0 ? void 0 : _b.endpoint) || HTTP_URL;
|
|
167
|
+
const endpoint = ((_a = request.extensions) === null || _a === void 0 ? void 0 : _a.endpoint) || HTTP_URL;
|
|
172
168
|
const headers = Object.assign({
|
|
173
169
|
accept,
|
|
174
|
-
}, options === null || options === void 0 ? void 0 : options.headers, ((
|
|
170
|
+
}, options === null || options === void 0 ? void 0 : options.headers, ((_b = request.extensions) === null || _b === void 0 ? void 0 : _b.headers) || {});
|
|
175
171
|
const query = print(request.document);
|
|
176
172
|
const requestBody = {
|
|
177
173
|
query,
|
|
@@ -201,32 +197,18 @@ export class UrlLoader {
|
|
|
201
197
|
signal: controller === null || controller === void 0 ? void 0 : controller.signal,
|
|
202
198
|
}, request.context, request.info);
|
|
203
199
|
case 'POST':
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
headers
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
.resolve();
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
return fetch(endpoint, {
|
|
220
|
-
method: 'POST',
|
|
221
|
-
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
222
|
-
body: JSON.stringify(requestBody),
|
|
223
|
-
headers: {
|
|
224
|
-
'content-type': 'application/json',
|
|
225
|
-
...headers,
|
|
226
|
-
},
|
|
227
|
-
signal: controller === null || controller === void 0 ? void 0 : controller.signal,
|
|
228
|
-
}, request.context, request.info);
|
|
229
|
-
}
|
|
200
|
+
return new ValueOrPromise(() => this.createFormDataFromVariables(requestBody))
|
|
201
|
+
.then(body => fetch(endpoint, {
|
|
202
|
+
method: 'POST',
|
|
203
|
+
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
204
|
+
body,
|
|
205
|
+
headers: {
|
|
206
|
+
...headers,
|
|
207
|
+
...(typeof body === 'string' ? { 'content-type': 'application/json' } : {}),
|
|
208
|
+
},
|
|
209
|
+
signal: controller === null || controller === void 0 ? void 0 : controller.signal,
|
|
210
|
+
}, request.context, request.info))
|
|
211
|
+
.resolve();
|
|
230
212
|
}
|
|
231
213
|
})
|
|
232
214
|
.then((fetchResult) => {
|
|
@@ -255,13 +237,66 @@ export class UrlLoader {
|
|
|
255
237
|
else {
|
|
256
238
|
return result;
|
|
257
239
|
}
|
|
240
|
+
})
|
|
241
|
+
.catch((e) => {
|
|
242
|
+
if (typeof e === 'string') {
|
|
243
|
+
return {
|
|
244
|
+
errors: [
|
|
245
|
+
createGraphQLError(e, {
|
|
246
|
+
extensions: {
|
|
247
|
+
requestBody,
|
|
248
|
+
},
|
|
249
|
+
}),
|
|
250
|
+
],
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
else if (e.name === 'GraphQLError') {
|
|
254
|
+
return {
|
|
255
|
+
errors: [e],
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
else if (e.name === 'TypeError' && e.message === 'fetch failed') {
|
|
259
|
+
return {
|
|
260
|
+
errors: [
|
|
261
|
+
createGraphQLError(`fetch failed to ${endpoint}`, {
|
|
262
|
+
extensions: {
|
|
263
|
+
requestBody,
|
|
264
|
+
},
|
|
265
|
+
originalError: e,
|
|
266
|
+
}),
|
|
267
|
+
],
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
else if (e.message) {
|
|
271
|
+
return {
|
|
272
|
+
errors: [
|
|
273
|
+
createGraphQLError(e.message, {
|
|
274
|
+
extensions: {
|
|
275
|
+
requestBody,
|
|
276
|
+
},
|
|
277
|
+
originalError: e,
|
|
278
|
+
}),
|
|
279
|
+
],
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return {
|
|
284
|
+
errors: [
|
|
285
|
+
createGraphQLError('Unknown error', {
|
|
286
|
+
extensions: {
|
|
287
|
+
requestBody,
|
|
288
|
+
},
|
|
289
|
+
originalError: e,
|
|
290
|
+
}),
|
|
291
|
+
],
|
|
292
|
+
};
|
|
293
|
+
}
|
|
258
294
|
})
|
|
259
295
|
.resolve();
|
|
260
296
|
};
|
|
261
297
|
if ((options === null || options === void 0 ? void 0 : options.retry) != null) {
|
|
262
298
|
return function retryExecutor(request) {
|
|
263
299
|
let result;
|
|
264
|
-
let error;
|
|
265
300
|
let attempt = 0;
|
|
266
301
|
function retryAttempt() {
|
|
267
302
|
attempt++;
|
|
@@ -269,10 +304,9 @@ export class UrlLoader {
|
|
|
269
304
|
if (result != null) {
|
|
270
305
|
return result;
|
|
271
306
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
throw new Error('No result');
|
|
307
|
+
return {
|
|
308
|
+
errors: [createGraphQLError('No response returned from fetch')],
|
|
309
|
+
};
|
|
276
310
|
}
|
|
277
311
|
return new ValueOrPromise(() => executor(request))
|
|
278
312
|
.then(res => {
|
|
@@ -282,10 +316,6 @@ export class UrlLoader {
|
|
|
282
316
|
return retryAttempt();
|
|
283
317
|
}
|
|
284
318
|
return result;
|
|
285
|
-
})
|
|
286
|
-
.catch((e) => {
|
|
287
|
-
error = e;
|
|
288
|
-
return retryAttempt();
|
|
289
319
|
})
|
|
290
320
|
.resolve();
|
|
291
321
|
}
|
|
@@ -499,8 +529,7 @@ export class UrlLoader {
|
|
|
499
529
|
// eslint-disable-next-line no-inner-declarations
|
|
500
530
|
function getExecutorByRequest(request) {
|
|
501
531
|
const operationAst = getOperationASTFromRequest(request);
|
|
502
|
-
if (operationAst.operation === 'subscription' ||
|
|
503
|
-
isLiveQueryOperationDefinitionNode(operationAst, request.variables)) {
|
|
532
|
+
if (operationAst.operation === 'subscription' || isLiveQueryOperationDefinitionNode(operationAst)) {
|
|
504
533
|
return subscriptionExecutor$;
|
|
505
534
|
}
|
|
506
535
|
else {
|
package/esm/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { memoize1 } from '@graphql-tools/utils';
|
|
1
2
|
export function isBlob(obj) {
|
|
2
3
|
return typeof obj.arrayBuffer === 'function';
|
|
3
4
|
}
|
|
@@ -7,6 +8,10 @@ export function isGraphQLUpload(upload) {
|
|
|
7
8
|
export function isPromiseLike(obj) {
|
|
8
9
|
return typeof obj.then === 'function';
|
|
9
10
|
}
|
|
11
|
+
export const isLiveQueryOperationDefinitionNode = memoize1(function isLiveQueryOperationDefinitionNode(node) {
|
|
12
|
+
var _a;
|
|
13
|
+
return (_a = node.directives) === null || _a === void 0 ? void 0 : _a.some(directive => directive.name.value === 'live');
|
|
14
|
+
});
|
|
10
15
|
export var LEGACY_WS;
|
|
11
16
|
(function (LEGACY_WS) {
|
|
12
17
|
LEGACY_WS["CONNECTION_INIT"] = "connection_init";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/url-loader",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.16.0-alpha-20220909134330-9a789de9",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@graphql-tools/delegate": "9.0.5",
|
|
11
11
|
"@graphql-tools/utils": "8.11.0",
|
|
12
|
-
"@graphql-tools/wrap": "9.0
|
|
12
|
+
"@graphql-tools/wrap": "9.1.0-alpha-20220909134330-9a789de9",
|
|
13
13
|
"@ardatan/sync-fetch": "0.0.1",
|
|
14
|
-
"@n1ru4l/graphql-live-query": "^0.10.0",
|
|
15
14
|
"@types/ws": "^8.0.0",
|
|
16
15
|
"@whatwg-node/fetch": "^0.3.0",
|
|
17
16
|
"dset": "^3.1.2",
|
package/typings/index.d.cts
CHANGED
|
@@ -55,10 +55,6 @@ export interface LoadFromUrlOptions extends BaseLoaderOptions, Partial<Introspec
|
|
|
55
55
|
* Whether to use the GET HTTP method for queries when querying the original schema
|
|
56
56
|
*/
|
|
57
57
|
useGETForQueries?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Use multipart for POST requests
|
|
60
|
-
*/
|
|
61
|
-
multipart?: boolean;
|
|
62
58
|
/**
|
|
63
59
|
* Handle URL as schema SDL
|
|
64
60
|
*/
|
|
@@ -75,10 +71,6 @@ export interface LoadFromUrlOptions extends BaseLoaderOptions, Partial<Introspec
|
|
|
75
71
|
* Use specific protocol for subscriptions
|
|
76
72
|
*/
|
|
77
73
|
subscriptionsProtocol?: SubscriptionProtocol;
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated This is no longer used. Will be removed in the next release
|
|
80
|
-
*/
|
|
81
|
-
graphqlSseOptions?: any;
|
|
82
74
|
/**
|
|
83
75
|
* Retry attempts
|
|
84
76
|
*/
|
|
@@ -100,6 +92,14 @@ export interface LoadFromUrlOptions extends BaseLoaderOptions, Partial<Introspec
|
|
|
100
92
|
* Enable Batching
|
|
101
93
|
*/
|
|
102
94
|
batch?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated This is no longer used. Will be removed in the next release
|
|
97
|
+
*/
|
|
98
|
+
graphqlSseOptions?: any;
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated This is no longer used. Will be removed in the next release
|
|
101
|
+
*/
|
|
102
|
+
multipart?: boolean;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* This loader loads a schema from a URL. The loaded schema is a fully-executable,
|
package/typings/index.d.ts
CHANGED
|
@@ -55,10 +55,6 @@ export interface LoadFromUrlOptions extends BaseLoaderOptions, Partial<Introspec
|
|
|
55
55
|
* Whether to use the GET HTTP method for queries when querying the original schema
|
|
56
56
|
*/
|
|
57
57
|
useGETForQueries?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Use multipart for POST requests
|
|
60
|
-
*/
|
|
61
|
-
multipart?: boolean;
|
|
62
58
|
/**
|
|
63
59
|
* Handle URL as schema SDL
|
|
64
60
|
*/
|
|
@@ -75,10 +71,6 @@ export interface LoadFromUrlOptions extends BaseLoaderOptions, Partial<Introspec
|
|
|
75
71
|
* Use specific protocol for subscriptions
|
|
76
72
|
*/
|
|
77
73
|
subscriptionsProtocol?: SubscriptionProtocol;
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated This is no longer used. Will be removed in the next release
|
|
80
|
-
*/
|
|
81
|
-
graphqlSseOptions?: any;
|
|
82
74
|
/**
|
|
83
75
|
* Retry attempts
|
|
84
76
|
*/
|
|
@@ -100,6 +92,14 @@ export interface LoadFromUrlOptions extends BaseLoaderOptions, Partial<Introspec
|
|
|
100
92
|
* Enable Batching
|
|
101
93
|
*/
|
|
102
94
|
batch?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated This is no longer used. Will be removed in the next release
|
|
97
|
+
*/
|
|
98
|
+
graphqlSseOptions?: any;
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated This is no longer used. Will be removed in the next release
|
|
101
|
+
*/
|
|
102
|
+
multipart?: boolean;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* This loader loads a schema from a URL. The loaded schema is a fully-executable,
|
package/typings/utils.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { OperationDefinitionNode } from 'graphql';
|
|
2
3
|
import type { Readable } from 'stream';
|
|
3
4
|
export declare function isBlob(obj: any): obj is Blob;
|
|
4
5
|
interface GraphQLUpload {
|
|
@@ -8,6 +9,7 @@ interface GraphQLUpload {
|
|
|
8
9
|
}
|
|
9
10
|
export declare function isGraphQLUpload(upload: any): upload is GraphQLUpload;
|
|
10
11
|
export declare function isPromiseLike(obj: any): obj is PromiseLike<any>;
|
|
12
|
+
export declare const isLiveQueryOperationDefinitionNode: (node: OperationDefinitionNode) => boolean | undefined;
|
|
11
13
|
export declare enum LEGACY_WS {
|
|
12
14
|
CONNECTION_INIT = "connection_init",
|
|
13
15
|
CONNECTION_ACK = "connection_ack",
|
package/typings/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { OperationDefinitionNode } from 'graphql';
|
|
2
3
|
import type { Readable } from 'stream';
|
|
3
4
|
export declare function isBlob(obj: any): obj is Blob;
|
|
4
5
|
interface GraphQLUpload {
|
|
@@ -8,6 +9,7 @@ interface GraphQLUpload {
|
|
|
8
9
|
}
|
|
9
10
|
export declare function isGraphQLUpload(upload: any): upload is GraphQLUpload;
|
|
10
11
|
export declare function isPromiseLike(obj: any): obj is PromiseLike<any>;
|
|
12
|
+
export declare const isLiveQueryOperationDefinitionNode: (node: OperationDefinitionNode) => boolean | undefined;
|
|
11
13
|
export declare enum LEGACY_WS {
|
|
12
14
|
CONNECTION_INIT = "connection_init",
|
|
13
15
|
CONNECTION_ACK = "connection_ack",
|