@graphql-codegen/core 2.6.1 → 2.6.3-alpha-20221025131227-aee11a778

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 CHANGED
@@ -206,8 +206,7 @@ function validateDuplicateDocuments(files) {
206
206
  `.trimRight())
207
207
  .join('');
208
208
  const definitionKindName = kind.replace('Definition', '').toLowerCase();
209
- throw new plugin_helpers_1.DetailedError(`Not all ${definitionKindName}s have an unique name: ${duplicated.join(', ')}`, `
210
- Not all ${definitionKindName}s have an unique name
209
+ throw new Error(`Not all ${definitionKindName}s have an unique name: ${duplicated.join(', ')}: \n
211
210
  ${list}
212
211
  `);
213
212
  }
@@ -6,7 +6,7 @@ const graphql_1 = require("graphql");
6
6
  async function executePlugin(options, plugin) {
7
7
  var _a;
8
8
  if (!plugin || !plugin.plugin || typeof plugin.plugin !== 'function') {
9
- throw new plugin_helpers_1.DetailedError(`Invalid Custom Plugin "${options.name}"`, `
9
+ throw new Error(`Invalid Custom Plugin "${options.name}" \n
10
10
  Plugin ${options.name} does not export a valid JS object with "plugin" function.
11
11
 
12
12
  Make sure your custom plugin is written in the following form:
@@ -28,7 +28,7 @@ async function executePlugin(options, plugin) {
28
28
  await profiler.run(async () => plugin.validate(outputSchema, documents, options.config, options.outputFilename, options.allPlugins, pluginContext), `Plugin ${options.name} validate`);
29
29
  }
30
30
  catch (e) {
31
- throw new plugin_helpers_1.DetailedError(`Plugin "${options.name}" validation failed:`, `
31
+ throw new Error(`Plugin "${options.name}" validation failed: \n
32
32
  ${e.message}
33
33
  `);
34
34
  }
package/esm/codegen.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DetailedError, isComplexPluginOutput, federationSpec, getCachedDocumentNodeFromSchema, createNoopProfiler, } from '@graphql-codegen/plugin-helpers';
1
+ import { isComplexPluginOutput, federationSpec, getCachedDocumentNodeFromSchema, createNoopProfiler, } from '@graphql-codegen/plugin-helpers';
2
2
  import { visit, Kind, print, specifiedRules } from 'graphql';
3
3
  import { executePlugin } from './execute-plugin.js';
4
4
  import { checkValidationErrors, validateGraphQlDocuments, asArray } from '@graphql-tools/utils';
@@ -201,8 +201,7 @@ function validateDuplicateDocuments(files) {
201
201
  `.trimRight())
202
202
  .join('');
203
203
  const definitionKindName = kind.replace('Definition', '').toLowerCase();
204
- throw new DetailedError(`Not all ${definitionKindName}s have an unique name: ${duplicated.join(', ')}`, `
205
- Not all ${definitionKindName}s have an unique name
204
+ throw new Error(`Not all ${definitionKindName}s have an unique name: ${duplicated.join(', ')}: \n
206
205
  ${list}
207
206
  `);
208
207
  }
@@ -1,9 +1,9 @@
1
- import { DetailedError, createNoopProfiler } from '@graphql-codegen/plugin-helpers';
1
+ import { createNoopProfiler } from '@graphql-codegen/plugin-helpers';
2
2
  import { buildASTSchema } from 'graphql';
3
3
  export async function executePlugin(options, plugin) {
4
4
  var _a;
5
5
  if (!plugin || !plugin.plugin || typeof plugin.plugin !== 'function') {
6
- throw new DetailedError(`Invalid Custom Plugin "${options.name}"`, `
6
+ throw new Error(`Invalid Custom Plugin "${options.name}" \n
7
7
  Plugin ${options.name} does not export a valid JS object with "plugin" function.
8
8
 
9
9
  Make sure your custom plugin is written in the following form:
@@ -25,7 +25,7 @@ export async function executePlugin(options, plugin) {
25
25
  await profiler.run(async () => plugin.validate(outputSchema, documents, options.config, options.outputFilename, options.allPlugins, pluginContext), `Plugin ${options.name} validate`);
26
26
  }
27
27
  catch (e) {
28
- throw new DetailedError(`Plugin "${options.name}" validation failed:`, `
28
+ throw new Error(`Plugin "${options.name}" validation failed: \n
29
29
  ${e.message}
30
30
  `);
31
31
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@graphql-codegen/core",
3
- "version": "2.6.1",
3
+ "version": "2.6.3-alpha-20221025131227-aee11a778",
4
4
  "peerDependencies": {
5
5
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
6
6
  },
7
7
  "dependencies": {
8
- "@graphql-codegen/plugin-helpers": "^2.6.2",
9
- "@graphql-tools/schema": "^8.5.0",
8
+ "@graphql-codegen/plugin-helpers": "2.7.2-alpha-20221025131227-aee11a778",
9
+ "@graphql-tools/schema": "^9.0.0",
10
10
  "@graphql-tools/utils": "^8.8.0",
11
11
  "tslib": "~2.4.0"
12
12
  },