@graphql-tools/github-loader 8.0.16 → 8.0.17-alpha-20250225134432-1fffa685435f455baf2e5f59334fcc6b9ca3cb72
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 +2 -1
- package/esm/index.js +3 -2
- package/package.json +4 -3
package/cjs/index.js
CHANGED
|
@@ -7,6 +7,7 @@ const sync_fetch_1 = tslib_1.__importDefault(require("sync-fetch"));
|
|
|
7
7
|
const graphql_tag_pluck_1 = require("@graphql-tools/graphql-tag-pluck");
|
|
8
8
|
const utils_1 = require("@graphql-tools/utils");
|
|
9
9
|
const fetch_1 = require("@whatwg-node/fetch");
|
|
10
|
+
const promise_helpers_1 = require("@whatwg-node/promise-helpers");
|
|
10
11
|
// github:owner/name#ref:path/to/file
|
|
11
12
|
function extractData(pointer) {
|
|
12
13
|
const [repo, file] = pointer.split('#');
|
|
@@ -41,7 +42,7 @@ class GithubLoader {
|
|
|
41
42
|
return [];
|
|
42
43
|
}
|
|
43
44
|
const { owner, name, ref, path } = extractData(pointer);
|
|
44
|
-
return (0,
|
|
45
|
+
return (0, promise_helpers_1.handleMaybePromise)(() => (0, promise_helpers_1.handleMaybePromise)(() => fetchFn('https://api.github.com/graphql', this.prepareRequest({ owner, ref, path, name, options })), response => {
|
|
45
46
|
const contentType = response.headers.get('content-type');
|
|
46
47
|
if (contentType && contentType.includes('application/json')) {
|
|
47
48
|
return response.json();
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { parse } from 'graphql';
|
|
2
2
|
import syncFetch from 'sync-fetch';
|
|
3
3
|
import { gqlPluckFromCodeStringSync, } from '@graphql-tools/graphql-tag-pluck';
|
|
4
|
-
import {
|
|
4
|
+
import { parseGraphQLJSON, parseGraphQLSDL, } from '@graphql-tools/utils';
|
|
5
5
|
import { fetch as asyncFetch } from '@whatwg-node/fetch';
|
|
6
|
+
import { handleMaybePromise } from '@whatwg-node/promise-helpers';
|
|
6
7
|
// github:owner/name#ref:path/to/file
|
|
7
8
|
function extractData(pointer) {
|
|
8
9
|
const [repo, file] = pointer.split('#');
|
|
@@ -37,7 +38,7 @@ export class GithubLoader {
|
|
|
37
38
|
return [];
|
|
38
39
|
}
|
|
39
40
|
const { owner, name, ref, path } = extractData(pointer);
|
|
40
|
-
return
|
|
41
|
+
return handleMaybePromise(() => handleMaybePromise(() => fetchFn('https://api.github.com/graphql', this.prepareRequest({ owner, ref, path, name, options })), response => {
|
|
41
42
|
const contentType = response.headers.get('content-type');
|
|
42
43
|
if (contentType && contentType.includes('application/json')) {
|
|
43
44
|
return response.json();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/github-loader",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.17-alpha-20250225134432-1fffa685435f455baf2e5f59334fcc6b9ca3cb72",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@graphql-tools/executor-http": "^1.1.9",
|
|
11
|
-
"@graphql-tools/graphql-tag-pluck": "
|
|
12
|
-
"@graphql-tools/utils": "
|
|
11
|
+
"@graphql-tools/graphql-tag-pluck": "8.3.16-alpha-20250225134432-1fffa685435f455baf2e5f59334fcc6b9ca3cb72",
|
|
12
|
+
"@graphql-tools/utils": "10.8.3-alpha-20250225134432-1fffa685435f455baf2e5f59334fcc6b9ca3cb72",
|
|
13
13
|
"@whatwg-node/fetch": "^0.10.0",
|
|
14
|
+
"@whatwg-node/promise-helpers": "^1.0.0",
|
|
14
15
|
"sync-fetch": "0.6.0-2",
|
|
15
16
|
"tslib": "^2.4.0"
|
|
16
17
|
},
|