@graphql-tools/graphql-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
@@ -7,6 +7,10 @@ export interface GraphQLFileLoaderOptions extends BaseLoaderOptions {
7
7
  * Set to `true` to disable handling `#import` syntax
8
8
  */
9
9
  skipGraphQLImport?: boolean;
10
+ /**
11
+ * Set to `true` to raise errors if any matched files are not valid GraphQL
12
+ */
13
+ noSilentErrors?: boolean;
10
14
  }
11
15
  /**
12
16
  * This loader loads documents and type definitions from `.graphql` files.
package/index.js CHANGED
@@ -104,7 +104,7 @@ class GraphQLFileLoader {
104
104
  }
105
105
  }
106
106
  }));
107
- if (finalResult.length === 0 && errors.length > 0) {
107
+ if (errors.length > 0 && (options.noSilentErrors || finalResult.length === 0)) {
108
108
  if (errors.length === 1) {
109
109
  throw errors[0];
110
110
  }
@@ -131,7 +131,7 @@ class GraphQLFileLoader {
131
131
  }
132
132
  }
133
133
  }
134
- if (finalResult.length === 0 && errors.length > 0) {
134
+ if (errors.length > 0 && (options.noSilentErrors || finalResult.length === 0)) {
135
135
  if (errors.length === 1) {
136
136
  throw errors[0];
137
137
  }
package/index.mjs CHANGED
@@ -98,7 +98,7 @@ class GraphQLFileLoader {
98
98
  }
99
99
  }
100
100
  }));
101
- if (finalResult.length === 0 && errors.length > 0) {
101
+ if (errors.length > 0 && (options.noSilentErrors || finalResult.length === 0)) {
102
102
  if (errors.length === 1) {
103
103
  throw errors[0];
104
104
  }
@@ -125,7 +125,7 @@ class GraphQLFileLoader {
125
125
  }
126
126
  }
127
127
  }
128
- if (finalResult.length === 0 && errors.length > 0) {
128
+ if (errors.length > 0 && (options.noSilentErrors || finalResult.length === 0)) {
129
129
  if (errors.length === 1) {
130
130
  throw errors[0];
131
131
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@graphql-tools/graphql-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/import": "^6.4.0",
11
- "@graphql-tools/utils": "9.0.0-alpha-be1b2ebd.0",
10
+ "@graphql-tools/import": "^6.5.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"