@graphql-tools/code-file-loader 7.1.1-alpha-be1b2ebd.0 → 7.2.0

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
@@ -4,6 +4,10 @@ export declare type CodeFileLoaderConfig = {
4
4
  pluckConfig?: GraphQLTagPluckOptions;
5
5
  noPluck?: boolean;
6
6
  noRequire?: boolean;
7
+ /**
8
+ * Set to `true` to raise errors if any matched files are not valid GraphQL
9
+ */
10
+ noSilentErrors?: boolean;
7
11
  };
8
12
  /**
9
13
  * Additional options for loading from a code file
package/index.js CHANGED
@@ -259,7 +259,7 @@ class CodeFileLoader {
259
259
  errors.push(e);
260
260
  }
261
261
  }));
262
- if (finalResult.length === 0 && errors.length > 0) {
262
+ if (errors.length > 0 && (options.noSilentErrors || finalResult.length === 0)) {
263
263
  if (errors.length === 1) {
264
264
  throw errors[0];
265
265
  }
@@ -286,7 +286,7 @@ class CodeFileLoader {
286
286
  }
287
287
  }
288
288
  }
289
- if (finalResult.length === 0 && errors.length > 0) {
289
+ if (errors.length > 0 && (options.noSilentErrors || finalResult.length === 0)) {
290
290
  if (errors.length === 1) {
291
291
  throw errors[0];
292
292
  }
package/index.mjs CHANGED
@@ -234,7 +234,7 @@ class CodeFileLoader {
234
234
  errors.push(e);
235
235
  }
236
236
  }));
237
- if (finalResult.length === 0 && errors.length > 0) {
237
+ if (errors.length > 0 && (options.noSilentErrors || finalResult.length === 0)) {
238
238
  if (errors.length === 1) {
239
239
  throw errors[0];
240
240
  }
@@ -261,7 +261,7 @@ class CodeFileLoader {
261
261
  }
262
262
  }
263
263
  }
264
- if (finalResult.length === 0 && errors.length > 0) {
264
+ if (errors.length > 0 && (options.noSilentErrors || finalResult.length === 0)) {
265
265
  if (errors.length === 1) {
266
266
  throw errors[0];
267
267
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@graphql-tools/code-file-loader",
3
- "version": "7.1.1-alpha-be1b2ebd.0",
3
+ "version": "7.2.0",
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"
8
8
  },
9
9
  "dependencies": {
10
- "@graphql-tools/graphql-tag-pluck": "7.1.2-alpha-be1b2ebd.0",
11
- "@graphql-tools/utils": "9.0.0-alpha-be1b2ebd.0",
10
+ "@graphql-tools/graphql-tag-pluck": "^7.1.0",
11
+ "@graphql-tools/utils": "^8.2.0",
12
12
  "globby": "^11.0.3",
13
13
  "tslib": "~2.3.0",
14
14
  "unixify": "^1.0.0"