@graphql-tools/load 8.0.7 → 8.0.8
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/documents.js +3 -3
- package/cjs/load-typedefs/collect-sources.js +19 -10
- package/cjs/load-typedefs/load-file.js +2 -3
- package/cjs/load-typedefs/options.js +1 -2
- package/cjs/load-typedefs/parse.js +1 -2
- package/cjs/load-typedefs.js +2 -3
- package/cjs/schema.js +2 -3
- package/cjs/utils/custom-loader.js +3 -4
- package/cjs/utils/helpers.js +3 -4
- package/cjs/utils/pointers.js +1 -2
- package/cjs/utils/queue.js +2 -3
- package/package.json +3 -3
package/cjs/documents.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.NON_OPERATION_KINDS = exports.OPERATION_KINDS = void 0;
|
|
4
|
+
exports.loadDocuments = loadDocuments;
|
|
5
|
+
exports.loadDocumentsSync = loadDocumentsSync;
|
|
4
6
|
const graphql_1 = require("graphql");
|
|
5
7
|
const load_typedefs_js_1 = require("./load-typedefs.js");
|
|
6
8
|
/**
|
|
@@ -28,7 +30,6 @@ function loadDocuments(pointerOrPointers, options) {
|
|
|
28
30
|
...options,
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
|
-
exports.loadDocuments = loadDocuments;
|
|
32
33
|
/**
|
|
33
34
|
* Synchronously loads executable documents (i.e. operations and fragments) from
|
|
34
35
|
* the provided pointers. The pointers may be individual files or a glob pattern.
|
|
@@ -44,4 +45,3 @@ function loadDocumentsSync(pointerOrPointers, options) {
|
|
|
44
45
|
...options,
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
exports.loadDocumentsSync = loadDocumentsSync;
|
|
@@ -15,15 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
36
|
+
exports.collectSources = collectSources;
|
|
37
|
+
exports.collectSourcesSync = collectSourcesSync;
|
|
27
38
|
const module_1 = require("module");
|
|
28
39
|
const process_1 = require("process");
|
|
29
40
|
const graphql_1 = require("graphql");
|
|
@@ -59,7 +70,6 @@ async function collectSources({ pointerOptionMap, options, }) {
|
|
|
59
70
|
(0, utils_1.debugTimerEnd)('@graphql-tools/load: collectSources queue');
|
|
60
71
|
return sources;
|
|
61
72
|
}
|
|
62
|
-
exports.collectSources = collectSources;
|
|
63
73
|
function collectSourcesSync({ pointerOptionMap, options, }) {
|
|
64
74
|
const sources = [];
|
|
65
75
|
const queue = (0, queue_js_1.useSyncQueue)();
|
|
@@ -86,7 +96,6 @@ function collectSourcesSync({ pointerOptionMap, options, }) {
|
|
|
86
96
|
(0, utils_1.debugTimerEnd)('@graphql-tools/load: collectSourcesSync queue');
|
|
87
97
|
return sources;
|
|
88
98
|
}
|
|
89
|
-
exports.collectSourcesSync = collectSourcesSync;
|
|
90
99
|
function createHelpers({ sources, stack, }) {
|
|
91
100
|
const addSource = ({ source }) => {
|
|
92
101
|
sources.push(source);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.loadFile = loadFile;
|
|
4
|
+
exports.loadFileSync = loadFileSync;
|
|
4
5
|
const process_1 = require("process");
|
|
5
6
|
const utils_1 = require("@graphql-tools/utils");
|
|
6
7
|
async function loadFile(pointer, options) {
|
|
@@ -43,7 +44,6 @@ async function loadFile(pointer, options) {
|
|
|
43
44
|
(0, utils_1.debugTimerEnd)(`@graphql-tools/load: loadFile ${pointer}`);
|
|
44
45
|
return results;
|
|
45
46
|
}
|
|
46
|
-
exports.loadFile = loadFile;
|
|
47
47
|
function loadFileSync(pointer, options) {
|
|
48
48
|
(0, utils_1.debugTimerStart)(`@graphql-tools/load: loadFileSync ${pointer}`);
|
|
49
49
|
let results = options.cache?.[pointer];
|
|
@@ -85,4 +85,3 @@ function loadFileSync(pointer, options) {
|
|
|
85
85
|
(0, utils_1.debugTimerEnd)(`@graphql-tools/load: loadFileSync ${pointer}`);
|
|
86
86
|
return results;
|
|
87
87
|
}
|
|
88
|
-
exports.loadFileSync = loadFileSync;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyDefaultOptions =
|
|
3
|
+
exports.applyDefaultOptions = applyDefaultOptions;
|
|
4
4
|
const process_1 = require("process");
|
|
5
5
|
function applyDefaultOptions(options) {
|
|
6
6
|
options.cache = options.cache || {};
|
|
7
7
|
options.cwd = options.cwd || (0, process_1.cwd)();
|
|
8
8
|
options.sort = 'sort' in options ? options.sort : true;
|
|
9
9
|
}
|
|
10
|
-
exports.applyDefaultOptions = applyDefaultOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseSource =
|
|
3
|
+
exports.parseSource = parseSource;
|
|
4
4
|
const utils_1 = require("@graphql-tools/utils");
|
|
5
5
|
const filter_document_kind_js_1 = require("../filter-document-kind.js");
|
|
6
6
|
function parseSource({ partialSource, options, pointerOptionMap, addValidSource, }) {
|
|
@@ -21,7 +21,6 @@ function parseSource({ partialSource, options, pointerOptionMap, addValidSource,
|
|
|
21
21
|
(0, utils_1.debugTimerEnd)(`@graphql-tools/load: parseSource ${partialSource.location}`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
exports.parseSource = parseSource;
|
|
25
24
|
//
|
|
26
25
|
function prepareInput({ source, options, pointerOptionMap, }) {
|
|
27
26
|
let specificOptions = {
|
package/cjs/load-typedefs.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.loadTypedefs = loadTypedefs;
|
|
4
|
+
exports.loadTypedefsSync = loadTypedefsSync;
|
|
4
5
|
const utils_1 = require("@graphql-tools/utils");
|
|
5
6
|
const collect_sources_js_1 = require("./load-typedefs/collect-sources.js");
|
|
6
7
|
const options_js_1 = require("./load-typedefs/options.js");
|
|
@@ -41,7 +42,6 @@ async function loadTypedefs(pointerOrPointers, options) {
|
|
|
41
42
|
(0, utils_1.debugTimerEnd)('@graphql-tools/load: loadTypedefs');
|
|
42
43
|
return result;
|
|
43
44
|
}
|
|
44
|
-
exports.loadTypedefs = loadTypedefs;
|
|
45
45
|
/**
|
|
46
46
|
* Synchronously loads any GraphQL documents (i.e. executable documents like
|
|
47
47
|
* operations and fragments as well as type system definitions) from the
|
|
@@ -73,7 +73,6 @@ function loadTypedefsSync(pointerOrPointers, options) {
|
|
|
73
73
|
(0, utils_1.debugTimerEnd)('@graphql-tools/load: loadTypedefsSync');
|
|
74
74
|
return result;
|
|
75
75
|
}
|
|
76
|
-
exports.loadTypedefsSync = loadTypedefsSync;
|
|
77
76
|
//
|
|
78
77
|
function prepareResult({ options, pointerOptionMap, validSources, }) {
|
|
79
78
|
(0, utils_1.debugTimerStart)('@graphql-tools/load: prepareResult');
|
package/cjs/schema.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.loadSchema = loadSchema;
|
|
4
|
+
exports.loadSchemaSync = loadSchemaSync;
|
|
4
5
|
const graphql_1 = require("graphql");
|
|
5
6
|
const schema_1 = require("@graphql-tools/schema");
|
|
6
7
|
const utils_1 = require("@graphql-tools/utils");
|
|
@@ -18,7 +19,6 @@ async function loadSchema(schemaPointers, options) {
|
|
|
18
19
|
});
|
|
19
20
|
return getSchemaFromSources(sources, options);
|
|
20
21
|
}
|
|
21
|
-
exports.loadSchema = loadSchema;
|
|
22
22
|
/**
|
|
23
23
|
* Synchronously loads a schema from the provided pointers.
|
|
24
24
|
* @param schemaPointers Pointers to the sources to load the schema from
|
|
@@ -31,7 +31,6 @@ function loadSchemaSync(schemaPointers, options) {
|
|
|
31
31
|
});
|
|
32
32
|
return getSchemaFromSources(sources, options);
|
|
33
33
|
}
|
|
34
|
-
exports.loadSchemaSync = loadSchemaSync;
|
|
35
34
|
function includeSources(schema, sources) {
|
|
36
35
|
const finalSources = [];
|
|
37
36
|
for (const source of sources) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getCustomLoaderByPath = getCustomLoaderByPath;
|
|
4
|
+
exports.useCustomLoader = useCustomLoader;
|
|
5
|
+
exports.useCustomLoaderSync = useCustomLoaderSync;
|
|
4
6
|
const module_1 = require("module");
|
|
5
7
|
const path_1 = require("path");
|
|
6
8
|
function getCustomLoaderByPath(path, cwd) {
|
|
@@ -19,7 +21,6 @@ function getCustomLoaderByPath(path, cwd) {
|
|
|
19
21
|
catch (e) { }
|
|
20
22
|
return null;
|
|
21
23
|
}
|
|
22
|
-
exports.getCustomLoaderByPath = getCustomLoaderByPath;
|
|
23
24
|
async function useCustomLoader(loaderPointer, cwd) {
|
|
24
25
|
let loader;
|
|
25
26
|
if (typeof loaderPointer === 'string') {
|
|
@@ -33,7 +34,6 @@ async function useCustomLoader(loaderPointer, cwd) {
|
|
|
33
34
|
}
|
|
34
35
|
return loader;
|
|
35
36
|
}
|
|
36
|
-
exports.useCustomLoader = useCustomLoader;
|
|
37
37
|
function useCustomLoaderSync(loaderPointer, cwd) {
|
|
38
38
|
let loader;
|
|
39
39
|
if (typeof loaderPointer === 'string') {
|
|
@@ -47,4 +47,3 @@ function useCustomLoaderSync(loaderPointer, cwd) {
|
|
|
47
47
|
}
|
|
48
48
|
return loader;
|
|
49
49
|
}
|
|
50
|
-
exports.useCustomLoaderSync = useCustomLoaderSync;
|
package/cjs/utils/helpers.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.stringToHash = stringToHash;
|
|
4
|
+
exports.useStack = useStack;
|
|
5
|
+
exports.useLimit = useLimit;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
const p_limit_1 = tslib_1.__importDefault(require("p-limit"));
|
|
6
8
|
/**
|
|
@@ -21,7 +23,6 @@ function stringToHash(str) {
|
|
|
21
23
|
}
|
|
22
24
|
return hash;
|
|
23
25
|
}
|
|
24
|
-
exports.stringToHash = stringToHash;
|
|
25
26
|
function useStack(...fns) {
|
|
26
27
|
return (input) => {
|
|
27
28
|
function createNext(i) {
|
|
@@ -35,8 +36,6 @@ function useStack(...fns) {
|
|
|
35
36
|
fns[0](input, createNext(1));
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
exports.useStack = useStack;
|
|
39
39
|
function useLimit(concurrency) {
|
|
40
40
|
return (0, p_limit_1.default)(concurrency);
|
|
41
41
|
}
|
|
42
|
-
exports.useLimit = useLimit;
|
package/cjs/utils/pointers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizePointers =
|
|
3
|
+
exports.normalizePointers = normalizePointers;
|
|
4
4
|
const utils_1 = require("@graphql-tools/utils");
|
|
5
5
|
function normalizePointers(unnormalizedPointerOrPointers) {
|
|
6
6
|
(0, utils_1.debugTimerStart)('@graphql-tools/load: normalizePointers');
|
|
@@ -32,4 +32,3 @@ function normalizePointers(unnormalizedPointerOrPointers) {
|
|
|
32
32
|
(0, utils_1.debugTimerEnd)('@graphql-tools/load: normalizePointers');
|
|
33
33
|
return { ignore, pointerOptionMap };
|
|
34
34
|
}
|
|
35
|
-
exports.normalizePointers = normalizePointers;
|
package/cjs/utils/queue.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useQueue = useQueue;
|
|
4
|
+
exports.useSyncQueue = useSyncQueue;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const p_limit_1 = tslib_1.__importDefault(require("p-limit"));
|
|
6
7
|
function useQueue(options) {
|
|
@@ -17,7 +18,6 @@ function useQueue(options) {
|
|
|
17
18
|
},
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
exports.useQueue = useQueue;
|
|
21
21
|
function useSyncQueue() {
|
|
22
22
|
const queue = [];
|
|
23
23
|
return {
|
|
@@ -31,4 +31,3 @@ function useSyncQueue() {
|
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
exports.useSyncQueue = useSyncQueue;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/load",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.8",
|
|
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 || ^17.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/schema": "^10.0.
|
|
11
|
-
"@graphql-tools/utils": "^10.6.
|
|
10
|
+
"@graphql-tools/schema": "^10.0.12",
|
|
11
|
+
"@graphql-tools/utils": "^10.6.3",
|
|
12
12
|
"p-limit": "3.1.0",
|
|
13
13
|
"tslib": "^2.4.0"
|
|
14
14
|
},
|