@graphql-tools/url-loader 7.13.9 → 7.13.10-alpha-20220815173503-a11014cc
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 +7 -3
- package/esm/index.js +7 -3
- package/package.json +5 -7
- package/typings/event-stream/handleEventStreamResponse.d.cts +1 -1
- package/typings/event-stream/handleEventStreamResponse.d.ts +1 -1
- package/typings/event-stream/handleReadableStream.d.cts +2 -2
- package/typings/event-stream/handleReadableStream.d.ts +2 -2
- package/typings/handleMultipartMixedResponse.d.cts +2 -2
- package/typings/handleMultipartMixedResponse.d.ts +2 -2
- package/typings/index.d.cts +1 -1
- package/typings/index.d.ts +1 -1
package/cjs/index.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.UrlLoader = exports.SubscriptionProtocol = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/* eslint-disable no-case-declarations */
|
|
6
6
|
/// <reference lib="dom" />
|
|
7
|
-
const graphql_1 = require("graphql");
|
|
7
|
+
const graphql_1 = require("@graphql-tools/graphql");
|
|
8
8
|
const utils_1 = require("@graphql-tools/utils");
|
|
9
9
|
const wrap_1 = require("@graphql-tools/wrap");
|
|
10
10
|
const graphql_ws_1 = require("graphql-ws");
|
|
@@ -164,7 +164,8 @@ class UrlLoader {
|
|
|
164
164
|
if ((options === null || options === void 0 ? void 0 : options.useGETForQueries) && operationType === 'query') {
|
|
165
165
|
method = 'GET';
|
|
166
166
|
}
|
|
167
|
-
let accept = 'application/json';
|
|
167
|
+
let accept = 'application/json, multipart/mixed';
|
|
168
|
+
// @ts-expect-error Uses graphql-js so it doesn't like us
|
|
168
169
|
if (operationType === 'subscription' || (0, graphql_live_query_1.isLiveQueryOperationDefinitionNode)(operationAst)) {
|
|
169
170
|
method = 'GET';
|
|
170
171
|
accept = 'text/event-stream';
|
|
@@ -319,7 +320,9 @@ class UrlLoader {
|
|
|
319
320
|
variables: variables,
|
|
320
321
|
operationName,
|
|
321
322
|
extensions,
|
|
322
|
-
},
|
|
323
|
+
},
|
|
324
|
+
// @ts-expect-error Uses graphql-js so it doesn't like us
|
|
325
|
+
observer);
|
|
323
326
|
return {
|
|
324
327
|
unsubscribe,
|
|
325
328
|
};
|
|
@@ -505,6 +508,7 @@ class UrlLoader {
|
|
|
505
508
|
function getExecutorByRequest(request) {
|
|
506
509
|
const operationAst = (0, utils_1.getOperationASTFromRequest)(request);
|
|
507
510
|
if (operationAst.operation === 'subscription' ||
|
|
511
|
+
// @ts-expect-error Uses graphql-js so it doesn't like us
|
|
508
512
|
(0, graphql_live_query_1.isLiveQueryOperationDefinitionNode)(operationAst, request.variables)) {
|
|
509
513
|
return subscriptionExecutor$;
|
|
510
514
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-case-declarations */
|
|
2
2
|
/// <reference lib="dom" />
|
|
3
|
-
import { print, buildASTSchema, buildSchema, } from 'graphql';
|
|
3
|
+
import { print, buildASTSchema, buildSchema, } from '@graphql-tools/graphql';
|
|
4
4
|
import { observableToAsyncIterable, isAsyncIterable, parseGraphQLSDL, getOperationASTFromRequest, } from '@graphql-tools/utils';
|
|
5
5
|
import { introspectSchema, wrapSchema } from '@graphql-tools/wrap';
|
|
6
6
|
import { createClient } from 'graphql-ws';
|
|
@@ -160,7 +160,8 @@ export class UrlLoader {
|
|
|
160
160
|
if ((options === null || options === void 0 ? void 0 : options.useGETForQueries) && operationType === 'query') {
|
|
161
161
|
method = 'GET';
|
|
162
162
|
}
|
|
163
|
-
let accept = 'application/json';
|
|
163
|
+
let accept = 'application/json, multipart/mixed';
|
|
164
|
+
// @ts-expect-error Uses graphql-js so it doesn't like us
|
|
164
165
|
if (operationType === 'subscription' || isLiveQueryOperationDefinitionNode(operationAst)) {
|
|
165
166
|
method = 'GET';
|
|
166
167
|
accept = 'text/event-stream';
|
|
@@ -315,7 +316,9 @@ export class UrlLoader {
|
|
|
315
316
|
variables: variables,
|
|
316
317
|
operationName,
|
|
317
318
|
extensions,
|
|
318
|
-
},
|
|
319
|
+
},
|
|
320
|
+
// @ts-expect-error Uses graphql-js so it doesn't like us
|
|
321
|
+
observer);
|
|
319
322
|
return {
|
|
320
323
|
unsubscribe,
|
|
321
324
|
};
|
|
@@ -501,6 +504,7 @@ export class UrlLoader {
|
|
|
501
504
|
function getExecutorByRequest(request) {
|
|
502
505
|
const operationAst = getOperationASTFromRequest(request);
|
|
503
506
|
if (operationAst.operation === 'subscription' ||
|
|
507
|
+
// @ts-expect-error Uses graphql-js so it doesn't like us
|
|
504
508
|
isLiveQueryOperationDefinitionNode(operationAst, request.variables)) {
|
|
505
509
|
return subscriptionExecutor$;
|
|
506
510
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/url-loader",
|
|
3
|
-
"version": "7.13.
|
|
3
|
+
"version": "7.13.10-alpha-20220815173503-a11014cc",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"peerDependencies": {
|
|
7
|
-
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
8
|
-
},
|
|
9
6
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/delegate": "9.0.
|
|
11
|
-
"@graphql-tools/utils": "8.10.
|
|
12
|
-
"@graphql-tools/wrap": "9.0.
|
|
7
|
+
"@graphql-tools/delegate": "9.0.4-alpha-20220815173503-a11014cc",
|
|
8
|
+
"@graphql-tools/utils": "8.10.1-alpha-20220815173503-a11014cc",
|
|
9
|
+
"@graphql-tools/wrap": "9.0.5-alpha-20220815173503-a11014cc",
|
|
13
10
|
"@ardatan/sync-fetch": "0.0.1",
|
|
14
11
|
"@n1ru4l/graphql-live-query": "^0.10.0",
|
|
12
|
+
"@graphql-tools/graphql": "0.1.0-alpha-20220815173503-a11014cc",
|
|
15
13
|
"@types/ws": "^8.0.0",
|
|
16
14
|
"@whatwg-node/fetch": "^0.2.9",
|
|
17
15
|
"dset": "^3.1.2",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExecutionResult } from 'graphql';
|
|
1
|
+
import { ExecutionResult } from '@graphql-tools/graphql';
|
|
2
2
|
export declare function isReadableStream(value: any): value is ReadableStream;
|
|
3
3
|
export declare function handleEventStreamResponse(response: Response, controller?: AbortController): Promise<AsyncIterable<ExecutionResult>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExecutionResult } from 'graphql';
|
|
1
|
+
import { ExecutionResult } from '@graphql-tools/graphql';
|
|
2
2
|
export declare function isReadableStream(value: any): value is ReadableStream;
|
|
3
3
|
export declare function handleEventStreamResponse(response: Response, controller?: AbortController): Promise<AsyncIterable<ExecutionResult>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ExecutionResult } from 'graphql';
|
|
2
|
-
export declare function handleReadableStream(readableStream: ReadableStream<Uint8Array>): AsyncIterableIterator<ExecutionResult<import("graphql/jsutils/ObjMap").ObjMap<unknown>, import("graphql/jsutils/ObjMap").ObjMap<unknown>>>;
|
|
1
|
+
import { ExecutionResult } from '@graphql-tools/graphql';
|
|
2
|
+
export declare function handleReadableStream(readableStream: ReadableStream<Uint8Array>): AsyncIterableIterator<ExecutionResult<import("../../../../graphql/src/jsutils/ObjMap").ObjMap<unknown>, import("../../../../graphql/src/jsutils/ObjMap").ObjMap<unknown>>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ExecutionResult } from 'graphql';
|
|
2
|
-
export declare function handleReadableStream(readableStream: ReadableStream<Uint8Array>): AsyncIterableIterator<ExecutionResult<import("graphql/jsutils/ObjMap").ObjMap<unknown>, import("graphql/jsutils/ObjMap").ObjMap<unknown>>>;
|
|
1
|
+
import { ExecutionResult } from '@graphql-tools/graphql';
|
|
2
|
+
export declare function handleReadableStream(readableStream: ReadableStream<Uint8Array>): AsyncIterableIterator<ExecutionResult<import("../../../../graphql/src/jsutils/ObjMap").ObjMap<unknown>, import("../../../../graphql/src/jsutils/ObjMap").ObjMap<unknown>>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ExecutionResult } from 'graphql';
|
|
2
|
-
export declare function handleMultipartMixedResponse(response: Response, controller?: AbortController): Promise<AsyncIterable<ExecutionResult<import("graphql/jsutils/ObjMap").ObjMap<unknown>, import("graphql/jsutils/ObjMap").ObjMap<unknown>> | undefined>>;
|
|
1
|
+
import type { ExecutionResult } from '@graphql-tools/graphql';
|
|
2
|
+
export declare function handleMultipartMixedResponse(response: Response, controller?: AbortController): Promise<AsyncIterable<ExecutionResult<import("../../../graphql/src/jsutils/ObjMap.js").ObjMap<unknown>, import("../../../graphql/src/jsutils/ObjMap.js").ObjMap<unknown>> | undefined>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ExecutionResult } from 'graphql';
|
|
2
|
-
export declare function handleMultipartMixedResponse(response: Response, controller?: AbortController): Promise<AsyncIterable<ExecutionResult<import("graphql/jsutils/ObjMap").ObjMap<unknown>, import("graphql/jsutils/ObjMap").ObjMap<unknown>> | undefined>>;
|
|
1
|
+
import type { ExecutionResult } from '@graphql-tools/graphql';
|
|
2
|
+
export declare function handleMultipartMixedResponse(response: Response, controller?: AbortController): Promise<AsyncIterable<ExecutionResult<import("../../../graphql/src/jsutils/ObjMap.js").ObjMap<unknown>, import("../../../graphql/src/jsutils/ObjMap.js").ObjMap<unknown>> | undefined>>;
|
package/typings/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="ws" />
|
|
2
2
|
/// <reference lib="dom" />
|
|
3
|
-
import { IntrospectionOptions } from 'graphql';
|
|
3
|
+
import { IntrospectionOptions } from '@graphql-tools/graphql';
|
|
4
4
|
import { AsyncExecutor, Executor, SyncExecutor, Source, Loader, BaseLoaderOptions } from '@graphql-tools/utils';
|
|
5
5
|
import { ClientOptions } from 'graphql-ws';
|
|
6
6
|
import WebSocket from 'isomorphic-ws';
|
package/typings/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="ws" />
|
|
2
2
|
/// <reference lib="dom" />
|
|
3
|
-
import { IntrospectionOptions } from 'graphql';
|
|
3
|
+
import { IntrospectionOptions } from '@graphql-tools/graphql';
|
|
4
4
|
import { AsyncExecutor, Executor, SyncExecutor, Source, Loader, BaseLoaderOptions } from '@graphql-tools/utils';
|
|
5
5
|
import { ClientOptions } from 'graphql-ws';
|
|
6
6
|
import WebSocket from 'isomorphic-ws';
|