@graphql-tools/github-loader 7.2.2 → 7.2.3

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
@@ -1,7 +1,7 @@
1
1
  import { Loader, BaseLoaderOptions, Source } from '@graphql-tools/utils';
2
2
  import { GraphQLTagPluckOptions } from '@graphql-tools/graphql-tag-pluck';
3
3
  import syncFetch from 'sync-fetch';
4
- import asyncFetch from 'cross-undici-fetch';
4
+ import { fetch as asyncFetch } from 'cross-undici-fetch';
5
5
  /**
6
6
  * Additional options for loading from GitHub
7
7
  */
package/index.js CHANGED
@@ -8,7 +8,7 @@ const utils = require('@graphql-tools/utils');
8
8
  const graphqlTagPluck = require('@graphql-tools/graphql-tag-pluck');
9
9
  const graphql = require('graphql');
10
10
  const syncFetch = _interopDefault(require('sync-fetch'));
11
- const asyncFetch = _interopDefault(require('cross-undici-fetch'));
11
+ const crossUndiciFetch = require('cross-undici-fetch');
12
12
 
13
13
  // github:owner/name#ref:path/to/file
14
14
  function extractData(pointer) {
@@ -44,7 +44,7 @@ class GithubLoader {
44
44
  return [];
45
45
  }
46
46
  const { owner, name, ref, path } = extractData(pointer);
47
- const fetch = options.customFetch || asyncFetch;
47
+ const fetch = options.customFetch || crossUndiciFetch.fetch;
48
48
  const request = await fetch('https://api.github.com/graphql', this.prepareRequest({ owner, ref, path, name, options }));
49
49
  const response = await request.json();
50
50
  return this.handleResponse({ pointer, path, options, response });
package/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { parseGraphQLSDL, parseGraphQLJSON } from '@graphql-tools/utils';
2
2
  import { gqlPluckFromCodeStringSync } from '@graphql-tools/graphql-tag-pluck';
3
3
  import { parse } from 'graphql';
4
4
  import syncFetch from 'sync-fetch';
5
- import asyncFetch from 'cross-undici-fetch';
5
+ import { fetch } from 'cross-undici-fetch';
6
6
 
7
7
  // github:owner/name#ref:path/to/file
8
8
  function extractData(pointer) {
@@ -38,8 +38,8 @@ class GithubLoader {
38
38
  return [];
39
39
  }
40
40
  const { owner, name, ref, path } = extractData(pointer);
41
- const fetch = options.customFetch || asyncFetch;
42
- const request = await fetch('https://api.github.com/graphql', this.prepareRequest({ owner, ref, path, name, options }));
41
+ const fetch$1 = options.customFetch || fetch;
42
+ const request = await fetch$1('https://api.github.com/graphql', this.prepareRequest({ owner, ref, path, name, options }));
43
43
  const response = await request.json();
44
44
  return this.handleResponse({ pointer, path, options, response });
45
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/github-loader",
3
- "version": "7.2.2",
3
+ "version": "7.2.3",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {