@envelop/sentry 4.0.2 → 4.0.3-alpha-20221027093244-bdb059d7
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/index.js +2 -8
- package/esm/index.js +2 -7
- package/package.json +3 -3
- package/typings/index.d.cts +2 -2
- package/typings/index.d.ts +2 -2
package/cjs/index.js
CHANGED
|
@@ -6,13 +6,7 @@ const core_1 = require("@envelop/core");
|
|
|
6
6
|
const on_resolve_1 = require("@envelop/on-resolve");
|
|
7
7
|
const Sentry = tslib_1.__importStar(require("@sentry/node"));
|
|
8
8
|
const graphql_1 = require("graphql");
|
|
9
|
-
|
|
10
|
-
if ((0, core_1.isGraphQLError)(error)) {
|
|
11
|
-
return (0, core_1.isGraphQLError)(error.originalError);
|
|
12
|
-
}
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
exports.defaultSkipError = defaultSkipError;
|
|
9
|
+
exports.defaultSkipError = core_1.isOriginalGraphQLError;
|
|
16
10
|
const sentryTracingSymbol = Symbol('sentryTracing');
|
|
17
11
|
const useSentry = (options = {}) => {
|
|
18
12
|
function pick(key, defaultValue) {
|
|
@@ -25,7 +19,7 @@ const useSentry = (options = {}) => {
|
|
|
25
19
|
const includeExecuteVariables = pick('includeExecuteVariables', false);
|
|
26
20
|
const renameTransaction = pick('renameTransaction', false);
|
|
27
21
|
const skipOperation = pick('skip', () => false);
|
|
28
|
-
const skipError = pick('skipError', defaultSkipError);
|
|
22
|
+
const skipError = pick('skipError', exports.defaultSkipError);
|
|
29
23
|
function addEventId(err, eventId) {
|
|
30
24
|
if (eventId === null) {
|
|
31
25
|
return err;
|
package/esm/index.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { handleStreamOrSingleExecutionResult,
|
|
1
|
+
import { handleStreamOrSingleExecutionResult, isOriginalGraphQLError, } from '@envelop/core';
|
|
2
2
|
import { useOnResolve } from '@envelop/on-resolve';
|
|
3
3
|
import * as Sentry from '@sentry/node';
|
|
4
4
|
import { GraphQLError, Kind, print, responsePathAsArray } from 'graphql';
|
|
5
|
-
export
|
|
6
|
-
if (isGraphQLError(error)) {
|
|
7
|
-
return isGraphQLError(error.originalError);
|
|
8
|
-
}
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
5
|
+
export const defaultSkipError = isOriginalGraphQLError;
|
|
11
6
|
const sentryTracingSymbol = Symbol('sentryTracing');
|
|
12
7
|
export const useSentry = (options = {}) => {
|
|
13
8
|
function pick(key, defaultValue) {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/sentry",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3-alpha-20221027093244-bdb059d7",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "
|
|
6
|
+
"@envelop/core": "3.0.3-alpha-20221027093244-bdb059d7",
|
|
7
7
|
"@sentry/node": "^6 || ^7",
|
|
8
8
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@envelop/on-resolve": "
|
|
11
|
+
"@envelop/on-resolve": "2.0.3-alpha-20221027093244-bdb059d7",
|
|
12
12
|
"tslib": "^2.4.0"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
package/typings/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from '@envelop/core';
|
|
1
|
+
import { Plugin, isOriginalGraphQLError } from '@envelop/core';
|
|
2
2
|
import * as Sentry from '@sentry/node';
|
|
3
3
|
import type { TraceparentData } from '@sentry/types';
|
|
4
4
|
import { ExecutionArgs } from 'graphql';
|
|
@@ -77,5 +77,5 @@ export declare type SentryPluginOptions = {
|
|
|
77
77
|
*/
|
|
78
78
|
skipError?: (args: Error) => boolean;
|
|
79
79
|
};
|
|
80
|
-
export declare
|
|
80
|
+
export declare const defaultSkipError: typeof isOriginalGraphQLError;
|
|
81
81
|
export declare const useSentry: (options?: SentryPluginOptions) => Plugin;
|
package/typings/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from '@envelop/core';
|
|
1
|
+
import { Plugin, isOriginalGraphQLError } from '@envelop/core';
|
|
2
2
|
import * as Sentry from '@sentry/node';
|
|
3
3
|
import type { TraceparentData } from '@sentry/types';
|
|
4
4
|
import { ExecutionArgs } from 'graphql';
|
|
@@ -77,5 +77,5 @@ export declare type SentryPluginOptions = {
|
|
|
77
77
|
*/
|
|
78
78
|
skipError?: (args: Error) => boolean;
|
|
79
79
|
};
|
|
80
|
-
export declare
|
|
80
|
+
export declare const defaultSkipError: typeof isOriginalGraphQLError;
|
|
81
81
|
export declare const useSentry: (options?: SentryPluginOptions) => Plugin;
|