@graphql-codegen/cli 5.0.6-alpha-20250415063426-d54f1aa6de171ace6045dc70d58eccf307af6cd7 → 5.0.6-alpha-20250415124548-4ca91db2c343643a1c1cddd0ccfd0088a0eb6e3e
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/codegen.js +2 -1
- package/cjs/load.js +5 -2
- package/esm/codegen.js +2 -1
- package/esm/load.js +6 -3
- package/package.json +4 -4
package/cjs/codegen.js
CHANGED
|
@@ -8,6 +8,7 @@ const os_1 = require("os");
|
|
|
8
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
9
|
const core_1 = require("@graphql-codegen/core");
|
|
10
10
|
const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
|
|
11
|
+
const load_1 = require("@graphql-tools/load");
|
|
11
12
|
const graphql_1 = require("graphql");
|
|
12
13
|
const listr2_1 = require("listr2");
|
|
13
14
|
const config_js_1 = require("./config.js");
|
|
@@ -221,7 +222,7 @@ async function executeCodegen(input) {
|
|
|
221
222
|
};
|
|
222
223
|
}
|
|
223
224
|
catch (error) {
|
|
224
|
-
if (config.ignoreNoDocuments) {
|
|
225
|
+
if (error instanceof load_1.NoTypeDefinitionsFound && config.ignoreNoDocuments) {
|
|
225
226
|
return {
|
|
226
227
|
documents: [],
|
|
227
228
|
};
|
package/cjs/load.js
CHANGED
|
@@ -88,8 +88,11 @@ async function loadDocuments(documentPointers, config) {
|
|
|
88
88
|
return loadedFromToolkit;
|
|
89
89
|
}
|
|
90
90
|
catch (error) {
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
// NoTypeDefinitionsFound from `@graphql-tools/load` already has a message with pointer, so we can just rethrow the error
|
|
92
|
+
if (error instanceof load_1.NoTypeDefinitionsFound) {
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
// For other errors, we need to add an error message with documentPointers, so it's better for DevX
|
|
93
96
|
throw new Error([`Failed to load documents from ${Object.keys(documentPointers).join(',')}:`, printError(error)].join('\n'));
|
|
94
97
|
}
|
|
95
98
|
}
|
package/esm/codegen.js
CHANGED
|
@@ -4,6 +4,7 @@ import { cpus } from 'os';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { codegen } from '@graphql-codegen/core';
|
|
6
6
|
import { getCachedDocumentNodeFromSchema, normalizeConfig, normalizeInstanceOrArray, normalizeOutputParam, } from '@graphql-codegen/plugin-helpers';
|
|
7
|
+
import { NoTypeDefinitionsFound } from '@graphql-tools/load';
|
|
7
8
|
import { GraphQLError } from 'graphql';
|
|
8
9
|
import { Listr } from 'listr2';
|
|
9
10
|
import { ensureContext, shouldEmitLegacyCommonJSImports } from './config.js';
|
|
@@ -217,7 +218,7 @@ export async function executeCodegen(input) {
|
|
|
217
218
|
};
|
|
218
219
|
}
|
|
219
220
|
catch (error) {
|
|
220
|
-
if (config.ignoreNoDocuments) {
|
|
221
|
+
if (error instanceof NoTypeDefinitionsFound && config.ignoreNoDocuments) {
|
|
221
222
|
return {
|
|
222
223
|
documents: [],
|
|
223
224
|
};
|
package/esm/load.js
CHANGED
|
@@ -5,7 +5,7 @@ import { GitLoader } from '@graphql-tools/git-loader';
|
|
|
5
5
|
import { GithubLoader } from '@graphql-tools/github-loader';
|
|
6
6
|
import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';
|
|
7
7
|
import { JsonFileLoader } from '@graphql-tools/json-file-loader';
|
|
8
|
-
import { loadDocuments as loadDocumentsToolkit, loadSchema as loadSchemaToolkit, } from '@graphql-tools/load';
|
|
8
|
+
import { loadDocuments as loadDocumentsToolkit, loadSchema as loadSchemaToolkit, NoTypeDefinitionsFound, } from '@graphql-tools/load';
|
|
9
9
|
import { PrismaLoader } from '@graphql-tools/prisma-loader';
|
|
10
10
|
import { UrlLoader } from '@graphql-tools/url-loader';
|
|
11
11
|
import { GraphQLError } from 'graphql';
|
|
@@ -83,8 +83,11 @@ export async function loadDocuments(documentPointers, config) {
|
|
|
83
83
|
return loadedFromToolkit;
|
|
84
84
|
}
|
|
85
85
|
catch (error) {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
// NoTypeDefinitionsFound from `@graphql-tools/load` already has a message with pointer, so we can just rethrow the error
|
|
87
|
+
if (error instanceof NoTypeDefinitionsFound) {
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
// For other errors, we need to add an error message with documentPointers, so it's better for DevX
|
|
88
91
|
throw new Error([`Failed to load documents from ${Object.keys(documentPointers).join(',')}:`, printError(error)].join('\n'));
|
|
89
92
|
}
|
|
90
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/cli",
|
|
3
|
-
"version": "5.0.6-alpha-
|
|
3
|
+
"version": "5.0.6-alpha-20250415124548-4ca91db2c343643a1c1cddd0ccfd0088a0eb6e3e",
|
|
4
4
|
"peerDependenciesMeta": {
|
|
5
5
|
"@parcel/watcher": {
|
|
6
6
|
"optional": true
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@babel/generator": "^7.18.13",
|
|
15
15
|
"@babel/template": "^7.18.10",
|
|
16
16
|
"@babel/types": "^7.18.13",
|
|
17
|
-
"@graphql-codegen/client-preset": "4.8.1-alpha-
|
|
17
|
+
"@graphql-codegen/client-preset": "4.8.1-alpha-20250415124548-4ca91db2c343643a1c1cddd0ccfd0088a0eb6e3e",
|
|
18
18
|
"@graphql-codegen/core": "^4.0.2",
|
|
19
19
|
"@graphql-codegen/plugin-helpers": "^5.0.3",
|
|
20
20
|
"@graphql-tools/apollo-engine-loader": "^8.0.0",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@graphql-tools/github-loader": "^8.0.0",
|
|
24
24
|
"@graphql-tools/graphql-file-loader": "^8.0.0",
|
|
25
25
|
"@graphql-tools/json-file-loader": "^8.0.0",
|
|
26
|
-
"@graphql-tools/load": "^8.
|
|
26
|
+
"@graphql-tools/load": "^8.1.0",
|
|
27
27
|
"@graphql-tools/prisma-loader": "^8.0.0",
|
|
28
28
|
"@graphql-tools/url-loader": "^8.0.0",
|
|
29
29
|
"@graphql-tools/utils": "^10.0.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"cosmiconfig": "^8.1.3",
|
|
33
33
|
"debounce": "^1.2.0",
|
|
34
34
|
"detect-indent": "^6.0.0",
|
|
35
|
-
"graphql-config": "^5.1.
|
|
35
|
+
"graphql-config": "^5.1.4",
|
|
36
36
|
"inquirer": "^8.0.0",
|
|
37
37
|
"is-glob": "^4.0.1",
|
|
38
38
|
"jiti": "^1.17.1",
|