@graphql-tools/url-loader 7.9.6 → 7.9.7

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/index.d.ts CHANGED
@@ -131,7 +131,7 @@ export declare class UrlLoader implements Loader<LoadFromUrlOptions> {
131
131
  getWebSocketImpl(importFn: AsyncImportFn, options?: LoadFromUrlOptions): PromiseLike<typeof WebSocket>;
132
132
  getWebSocketImpl(importFn: SyncImportFn, options?: LoadFromUrlOptions): typeof WebSocket;
133
133
  buildSubscriptionExecutor(subscriptionsEndpoint: string, fetch: SyncFetchFn, syncImport: SyncImportFn, options?: LoadFromUrlOptions): SyncExecutor;
134
- buildSubscriptionExecutor(subscriptionsEndpoint: string, fetch: AsyncFetchFn, asyncImport: AsyncImportFn, options?: LoadFromUrlOptions): Promise<AsyncExecutor> | AsyncExecutor;
134
+ buildSubscriptionExecutor(subscriptionsEndpoint: string, fetch: AsyncFetchFn, asyncImport: AsyncImportFn, options?: LoadFromUrlOptions): AsyncExecutor;
135
135
  getExecutor(endpoint: string, asyncImport: AsyncImportFn, options?: Omit<LoadFromUrlOptions, 'endpoint'>): AsyncExecutor;
136
136
  getExecutor(endpoint: string, syncImport: SyncImportFn, options?: Omit<LoadFromUrlOptions, 'endpoint'>): SyncExecutor;
137
137
  getExecutorAsync(endpoint: string, options?: Omit<LoadFromUrlOptions, 'endpoint'>): AsyncExecutor;
package/index.js CHANGED
@@ -690,7 +690,7 @@ class UrlLoader {
690
690
  }
691
691
  }
692
692
  getExecutor(endpoint, importFn, options) {
693
- const fetch$ = new valueOrPromise.ValueOrPromise(() => this.getFetch(options === null || options === void 0 ? void 0 : options.customFetch, asyncImport));
693
+ const fetch$ = new valueOrPromise.ValueOrPromise(() => this.getFetch(options === null || options === void 0 ? void 0 : options.customFetch, importFn));
694
694
  const httpExecutor$ = fetch$.then(fetch => {
695
695
  return this.buildHTTPExecutor(endpoint, fetch, options);
696
696
  });
@@ -760,10 +760,12 @@ class UrlLoader {
760
760
  if (options === null || options === void 0 ? void 0 : options.endpoint) {
761
761
  executor = this.getExecutorAsync(options.endpoint, options);
762
762
  }
763
- source.schema = wrap.wrapSchema({
764
- schema: source.schema,
765
- executor,
766
- });
763
+ if (executor) {
764
+ source.schema = wrap.wrapSchema({
765
+ schema: source.schema,
766
+ executor,
767
+ });
768
+ }
767
769
  return [source];
768
770
  }
769
771
  loadSync(pointer, options) {
@@ -798,10 +800,12 @@ class UrlLoader {
798
800
  if (options === null || options === void 0 ? void 0 : options.endpoint) {
799
801
  executor = this.getExecutorSync(options.endpoint, options);
800
802
  }
801
- source.schema = wrap.wrapSchema({
802
- schema: source.schema,
803
- executor,
804
- });
803
+ if (executor) {
804
+ source.schema = wrap.wrapSchema({
805
+ schema: source.schema,
806
+ executor,
807
+ });
808
+ }
805
809
  return [source];
806
810
  }
807
811
  }
package/index.mjs CHANGED
@@ -666,7 +666,7 @@ class UrlLoader {
666
666
  }
667
667
  }
668
668
  getExecutor(endpoint, importFn, options) {
669
- const fetch$ = new ValueOrPromise(() => this.getFetch(options === null || options === void 0 ? void 0 : options.customFetch, asyncImport));
669
+ const fetch$ = new ValueOrPromise(() => this.getFetch(options === null || options === void 0 ? void 0 : options.customFetch, importFn));
670
670
  const httpExecutor$ = fetch$.then(fetch => {
671
671
  return this.buildHTTPExecutor(endpoint, fetch, options);
672
672
  });
@@ -736,10 +736,12 @@ class UrlLoader {
736
736
  if (options === null || options === void 0 ? void 0 : options.endpoint) {
737
737
  executor = this.getExecutorAsync(options.endpoint, options);
738
738
  }
739
- source.schema = wrapSchema({
740
- schema: source.schema,
741
- executor,
742
- });
739
+ if (executor) {
740
+ source.schema = wrapSchema({
741
+ schema: source.schema,
742
+ executor,
743
+ });
744
+ }
743
745
  return [source];
744
746
  }
745
747
  loadSync(pointer, options) {
@@ -774,10 +776,12 @@ class UrlLoader {
774
776
  if (options === null || options === void 0 ? void 0 : options.endpoint) {
775
777
  executor = this.getExecutorSync(options.endpoint, options);
776
778
  }
777
- source.schema = wrapSchema({
778
- schema: source.schema,
779
- executor,
780
- });
779
+ if (executor) {
780
+ source.schema = wrapSchema({
781
+ schema: source.schema,
782
+ executor,
783
+ });
784
+ }
781
785
  return [source];
782
786
  }
783
787
  }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@graphql-tools/url-loader",
3
- "version": "7.9.6",
3
+ "version": "7.9.7",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
8
8
  },
9
9
  "dependencies": {
10
- "@graphql-tools/delegate": "8.6.1",
10
+ "@graphql-tools/delegate": "8.7.0",
11
11
  "@graphql-tools/utils": "8.6.5",
12
- "@graphql-tools/wrap": "8.4.8",
12
+ "@graphql-tools/wrap": "8.4.9",
13
13
  "@n1ru4l/graphql-live-query": "^0.9.0",
14
14
  "@types/websocket": "^1.0.4",
15
15
  "@types/ws": "^8.0.0",