@graphql-tools/url-loader 7.13.2-alpha-d9e3cbee.0 → 7.13.3-alpha-33fb2950.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.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultSyncFetch = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const sync_fetch_1 = tslib_1.__importDefault(require("sync-fetch"));
5
+ const sync_fetch_1 = tslib_1.__importDefault(require("@ardatan/sync-fetch"));
6
6
  const defaultSyncFetch = (input, init) => {
7
7
  if (typeof input === 'string') {
8
8
  init === null || init === void 0 ? true : delete init.signal;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handleAsyncIterable = void 0;
4
4
  /* eslint-disable no-labels */
5
5
  const fetch_1 = require("@whatwg-node/fetch");
6
- const textDecoder = new fetch_1.TextDecoder('handleAsyncIterable');
6
+ const textDecoder = new fetch_1.TextDecoder();
7
7
  async function* handleAsyncIterable(asyncIterable) {
8
8
  outer: for await (const chunk of asyncIterable) {
9
9
  const chunkStr = typeof chunk === 'string' ? chunk : textDecoder.decode(chunk, { stream: true });
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handleReadableStream = void 0;
4
4
  const utils_1 = require("@graphql-tools/utils");
5
5
  const fetch_1 = require("@whatwg-node/fetch");
6
- const textDecoder = new fetch_1.TextDecoder('handleReadableStream');
6
+ const textDecoder = new fetch_1.TextDecoder();
7
7
  function handleReadableStream(readableStream) {
8
8
  return (0, utils_1.observableToAsyncIterable)({
9
9
  subscribe: observer => {
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");
@@ -159,6 +159,7 @@ class UrlLoader {
159
159
  method = 'GET';
160
160
  }
161
161
  let accept = 'application/json, multipart/mixed';
162
+ // @ts-expect-error Uses graphql-js so it doesn't like us
162
163
  if (operationType === 'subscription' || (0, graphql_live_query_1.isLiveQueryOperationDefinitionNode)(operationAst)) {
163
164
  method = 'GET';
164
165
  accept = 'text/event-stream';
@@ -307,7 +308,9 @@ class UrlLoader {
307
308
  variables: variables,
308
309
  operationName,
309
310
  extensions,
310
- }, observer);
311
+ },
312
+ // @ts-expect-error Uses graphql-js so it doesn't like us
313
+ observer);
311
314
  return {
312
315
  unsubscribe,
313
316
  };
@@ -493,6 +496,7 @@ class UrlLoader {
493
496
  function getExecutorByRequest(request) {
494
497
  const operationAst = (0, utils_1.getOperationASTFromRequest)(request);
495
498
  if (operationAst.operation === 'subscription' ||
499
+ // @ts-expect-error Uses graphql-js so it doesn't like us
496
500
  (0, graphql_live_query_1.isLiveQueryOperationDefinitionNode)(operationAst, request.variables)) {
497
501
  return subscriptionExecutor$;
498
502
  }
@@ -1,4 +1,4 @@
1
- import syncFetchImported from 'sync-fetch';
1
+ import syncFetchImported from '@ardatan/sync-fetch';
2
2
  export const defaultSyncFetch = (input, init) => {
3
3
  if (typeof input === 'string') {
4
4
  init === null || init === void 0 ? true : delete init.signal;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-labels */
2
2
  import { TextDecoder } from '@whatwg-node/fetch';
3
- const textDecoder = new TextDecoder('handleAsyncIterable');
3
+ const textDecoder = new TextDecoder();
4
4
  export async function* handleAsyncIterable(asyncIterable) {
5
5
  outer: for await (const chunk of asyncIterable) {
6
6
  const chunkStr = typeof chunk === 'string' ? chunk : textDecoder.decode(chunk, { stream: true });
@@ -1,6 +1,6 @@
1
1
  import { observableToAsyncIterable } from '@graphql-tools/utils';
2
2
  import { TextDecoder } from '@whatwg-node/fetch';
3
- const textDecoder = new TextDecoder('handleReadableStream');
3
+ const textDecoder = new TextDecoder();
4
4
  export function handleReadableStream(readableStream) {
5
5
  return observableToAsyncIterable({
6
6
  subscribe: observer => {
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';
@@ -155,6 +155,7 @@ export class UrlLoader {
155
155
  method = 'GET';
156
156
  }
157
157
  let accept = 'application/json, multipart/mixed';
158
+ // @ts-expect-error Uses graphql-js so it doesn't like us
158
159
  if (operationType === 'subscription' || isLiveQueryOperationDefinitionNode(operationAst)) {
159
160
  method = 'GET';
160
161
  accept = 'text/event-stream';
@@ -303,7 +304,9 @@ export class UrlLoader {
303
304
  variables: variables,
304
305
  operationName,
305
306
  extensions,
306
- }, observer);
307
+ },
308
+ // @ts-expect-error Uses graphql-js so it doesn't like us
309
+ observer);
307
310
  return {
308
311
  unsubscribe,
309
312
  };
@@ -489,6 +492,7 @@ export class UrlLoader {
489
492
  function getExecutorByRequest(request) {
490
493
  const operationAst = getOperationASTFromRequest(request);
491
494
  if (operationAst.operation === 'subscription' ||
495
+ // @ts-expect-error Uses graphql-js so it doesn't like us
492
496
  isLiveQueryOperationDefinitionNode(operationAst, request.variables)) {
493
497
  return subscriptionExecutor$;
494
498
  }
package/package.json CHANGED
@@ -1,15 +1,14 @@
1
1
  {
2
2
  "name": "@graphql-tools/url-loader",
3
- "version": "7.13.2-alpha-d9e3cbee.0",
3
+ "version": "7.13.3-alpha-33fb2950.0",
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": "8.8.1",
11
- "@graphql-tools/utils": "8.9.0",
12
- "@graphql-tools/wrap": "8.5.1",
7
+ "@graphql-tools/delegate": "8.8.2-alpha-33fb2950.0",
8
+ "@graphql-tools/utils": "8.9.1-alpha-33fb2950.0",
9
+ "@graphql-tools/wrap": "8.5.2-alpha-33fb2950.0",
10
+ "@ardatan/sync-fetch": "0.0.1",
11
+ "@graphql-tools/graphql": "0.1.0-alpha-33fb2950.0",
13
12
  "@n1ru4l/graphql-live-query": "^0.9.0",
14
13
  "@types/ws": "^8.0.0",
15
14
  "@whatwg-node/fetch": "^0.2.4",
@@ -18,7 +17,6 @@
18
17
  "graphql-ws": "^5.4.1",
19
18
  "isomorphic-ws": "^5.0.0",
20
19
  "meros": "^1.1.4",
21
- "sync-fetch": "^0.4.0",
22
20
  "tslib": "^2.4.0",
23
21
  "value-or-promise": "^1.0.11",
24
22
  "ws": "^8.3.0"
@@ -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): 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 type { ExecutionResult } from 'graphql';
2
- export declare function handleMultipartMixedResponse(response: Response): Promise<AsyncIterableIterator<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): Promise<AsyncIterableIterator<ExecutionResult<import("../../../graphql/src/jsutils/ObjMap").ObjMap<unknown>, import("../../../graphql/src/jsutils/ObjMap").ObjMap<unknown>> | undefined>>;
@@ -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';