@envelop/core 2.2.0-alpha-e0e4d8e.0 → 2.2.0-alpha-4f3adf1.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.js +2 -2
- package/index.mjs +2 -2
- package/package.json +2 -2
- package/plugins/use-masked-errors.d.ts +13 -4
package/index.js
CHANGED
|
@@ -1182,7 +1182,7 @@ const useMaskedErrors = (opts) => {
|
|
|
1182
1182
|
const isDev = (_b = opts === null || opts === void 0 ? void 0 : opts.isDev) !== null && _b !== void 0 ? _b : (typeof process !== 'undefined' ? process.env['NODE_ENV'] === 'development' : false);
|
|
1183
1183
|
const handleResult = makeHandleResult$2(format, message, isDev);
|
|
1184
1184
|
return {
|
|
1185
|
-
onParse: (opts === null || opts === void 0 ? void 0 : opts.
|
|
1185
|
+
onParse: (opts === null || opts === void 0 ? void 0 : opts.handleParseErrors) === true
|
|
1186
1186
|
? function onParse() {
|
|
1187
1187
|
return function onParseEnd({ result, replaceParseResult }) {
|
|
1188
1188
|
if (result instanceof Error) {
|
|
@@ -1191,7 +1191,7 @@ const useMaskedErrors = (opts) => {
|
|
|
1191
1191
|
};
|
|
1192
1192
|
}
|
|
1193
1193
|
: undefined,
|
|
1194
|
-
onValidate: (opts === null || opts === void 0 ? void 0 : opts.
|
|
1194
|
+
onValidate: (opts === null || opts === void 0 ? void 0 : opts.handleValidationErrors) === true
|
|
1195
1195
|
? function onValidate() {
|
|
1196
1196
|
return function onValidateEnd({ valid, result, setResult }) {
|
|
1197
1197
|
if (valid === false) {
|
package/index.mjs
CHANGED
|
@@ -1178,7 +1178,7 @@ const useMaskedErrors = (opts) => {
|
|
|
1178
1178
|
const isDev = (_b = opts === null || opts === void 0 ? void 0 : opts.isDev) !== null && _b !== void 0 ? _b : (typeof process !== 'undefined' ? process.env['NODE_ENV'] === 'development' : false);
|
|
1179
1179
|
const handleResult = makeHandleResult$2(format, message, isDev);
|
|
1180
1180
|
return {
|
|
1181
|
-
onParse: (opts === null || opts === void 0 ? void 0 : opts.
|
|
1181
|
+
onParse: (opts === null || opts === void 0 ? void 0 : opts.handleParseErrors) === true
|
|
1182
1182
|
? function onParse() {
|
|
1183
1183
|
return function onParseEnd({ result, replaceParseResult }) {
|
|
1184
1184
|
if (result instanceof Error) {
|
|
@@ -1187,7 +1187,7 @@ const useMaskedErrors = (opts) => {
|
|
|
1187
1187
|
};
|
|
1188
1188
|
}
|
|
1189
1189
|
: undefined,
|
|
1190
|
-
onValidate: (opts === null || opts === void 0 ? void 0 : opts.
|
|
1190
|
+
onValidate: (opts === null || opts === void 0 ? void 0 : opts.handleValidationErrors) === true
|
|
1191
1191
|
? function onValidate() {
|
|
1192
1192
|
return function onValidateEnd({ valid, result, setResult }) {
|
|
1193
1193
|
if (valid === false) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/core",
|
|
3
|
-
"version": "2.2.0-alpha-
|
|
3
|
+
"version": "2.2.0-alpha-4f3adf1.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@envelop/types": "2.1.0-alpha-
|
|
9
|
+
"@envelop/types": "2.1.0-alpha-4f3adf1.0"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -17,14 +17,23 @@ export declare type UseMaskedErrorsOpts = {
|
|
|
17
17
|
*/
|
|
18
18
|
isDev?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
* Whether parse errors should be
|
|
20
|
+
* Whether parse errors should be processed by this plugin.
|
|
21
|
+
* In general it is not recommend to set this flag to `true`
|
|
22
|
+
* as a `parse` error contains useful information for debugging a GraphQL operation.
|
|
23
|
+
* A `parse` error never contains any sensitive information.
|
|
21
24
|
* @default false
|
|
22
25
|
*/
|
|
23
|
-
|
|
26
|
+
handleParseErrors?: boolean;
|
|
24
27
|
/**
|
|
25
|
-
* Whether validation errors should
|
|
28
|
+
* Whether validation errors should processed by this plugin.
|
|
29
|
+
* In general we recommend against setting this flag to `true`
|
|
30
|
+
* as a `validate` error contains useful information for debugging a GraphQL operation.
|
|
31
|
+
* A `validate` error contains "did you mean x" suggestions that make it easier
|
|
32
|
+
* to reverse-introspect a GraphQL schema whose introspection capabilities got disabled.
|
|
33
|
+
* Instead of disabling introspection and masking validation errors, using persisted operations
|
|
34
|
+
* is a safer solution for avoiding the execution of unwanted/arbitrary operations.
|
|
26
35
|
* @default false
|
|
27
36
|
*/
|
|
28
|
-
|
|
37
|
+
handleValidationErrors?: boolean;
|
|
29
38
|
};
|
|
30
39
|
export declare const useMaskedErrors: (opts?: UseMaskedErrorsOpts | undefined) => Plugin;
|