@envelop/sentry 5.1.1 → 5.1.2-alpha-20230220175948-cdba6d9f
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 +1 -6
- package/esm/index.js +2 -7
- package/package.json +2 -2
package/cjs/index.js
CHANGED
|
@@ -16,7 +16,6 @@ const useSentry = (options = {}) => {
|
|
|
16
16
|
const renameTransaction = pick('renameTransaction', false);
|
|
17
17
|
const skipOperation = pick('skip', () => false);
|
|
18
18
|
const skipError = pick('skipError', exports.defaultSkipError);
|
|
19
|
-
const printedDocumentsCache = new WeakMap();
|
|
20
19
|
const eventIdKey = options.eventIdKey === null ? null : 'sentryEventId';
|
|
21
20
|
function addEventId(err, eventId) {
|
|
22
21
|
if (eventIdKey !== null && eventId !== null) {
|
|
@@ -33,11 +32,7 @@ const useSentry = (options = {}) => {
|
|
|
33
32
|
// @ts-expect-error TODO: not sure how we will make it dev friendly
|
|
34
33
|
o => o.kind === graphql_1.Kind.OPERATION_DEFINITION);
|
|
35
34
|
const operationType = rootOperation.operation;
|
|
36
|
-
|
|
37
|
-
if (!document) {
|
|
38
|
-
document = (0, graphql_1.print)(args.document);
|
|
39
|
-
printedDocumentsCache.set(args.document, document);
|
|
40
|
-
}
|
|
35
|
+
const document = (0, core_1.getDocumentString)(args.document, graphql_1.print);
|
|
41
36
|
const opName = args.operationName || rootOperation.name?.value || 'Anonymous Operation';
|
|
42
37
|
const addedTags = (options.appendTags && options.appendTags(args)) || {};
|
|
43
38
|
const traceparentData = (options.traceparentData && options.traceparentData(args)) || {};
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { handleStreamOrSingleExecutionResult, isOriginalGraphQLError, } from '@envelop/core';
|
|
1
|
+
import { handleStreamOrSingleExecutionResult, isOriginalGraphQLError, getDocumentString, } from '@envelop/core';
|
|
2
2
|
import * as Sentry from '@sentry/node';
|
|
3
3
|
import { Kind, print } from 'graphql';
|
|
4
4
|
export const defaultSkipError = isOriginalGraphQLError;
|
|
@@ -12,7 +12,6 @@ export const useSentry = (options = {}) => {
|
|
|
12
12
|
const renameTransaction = pick('renameTransaction', false);
|
|
13
13
|
const skipOperation = pick('skip', () => false);
|
|
14
14
|
const skipError = pick('skipError', defaultSkipError);
|
|
15
|
-
const printedDocumentsCache = new WeakMap();
|
|
16
15
|
const eventIdKey = options.eventIdKey === null ? null : 'sentryEventId';
|
|
17
16
|
function addEventId(err, eventId) {
|
|
18
17
|
if (eventIdKey !== null && eventId !== null) {
|
|
@@ -29,11 +28,7 @@ export const useSentry = (options = {}) => {
|
|
|
29
28
|
// @ts-expect-error TODO: not sure how we will make it dev friendly
|
|
30
29
|
o => o.kind === Kind.OPERATION_DEFINITION);
|
|
31
30
|
const operationType = rootOperation.operation;
|
|
32
|
-
|
|
33
|
-
if (!document) {
|
|
34
|
-
document = print(args.document);
|
|
35
|
-
printedDocumentsCache.set(args.document, document);
|
|
36
|
-
}
|
|
31
|
+
const document = getDocumentString(args.document, print);
|
|
37
32
|
const opName = args.operationName || rootOperation.name?.value || 'Anonymous Operation';
|
|
38
33
|
const addedTags = (options.appendTags && options.appendTags(args)) || {};
|
|
39
34
|
const traceparentData = (options.traceparentData && options.traceparentData(args)) || {};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/sentry",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2-alpha-20230220175948-cdba6d9f",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "
|
|
6
|
+
"@envelop/core": "3.0.7-alpha-20230220175948-cdba6d9f",
|
|
7
7
|
"@sentry/node": "^6 || ^7",
|
|
8
8
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
9
9
|
},
|