@envelop/sentry 7.1.0 → 7.1.1
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/package.json +1 -1
- package/typings/index.d.cts +10 -9
- package/typings/index.d.ts +10 -9
package/package.json
CHANGED
package/typings/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExecutionArgs } from 'graphql';
|
|
2
|
+
import { isOriginalGraphQLError, type Plugin } from '@envelop/core';
|
|
2
3
|
import * as Sentry from '@sentry/node';
|
|
3
4
|
import type { TraceparentData } from '@sentry/types';
|
|
4
|
-
export type SentryPluginOptions
|
|
5
|
+
export type SentryPluginOptions = {
|
|
5
6
|
/**
|
|
6
7
|
* Starts a new transaction for every GraphQL Operation.
|
|
7
8
|
* When disabled, an already existing Transaction will be used.
|
|
@@ -37,34 +38,34 @@ export type SentryPluginOptions<PluginContext extends Record<string, any>> = {
|
|
|
37
38
|
/**
|
|
38
39
|
* Adds custom tags to every Transaction.
|
|
39
40
|
*/
|
|
40
|
-
appendTags?: (args:
|
|
41
|
+
appendTags?: (args: ExecutionArgs) => Record<string, unknown>;
|
|
41
42
|
/**
|
|
42
43
|
* Callback to set context information onto the scope.
|
|
43
44
|
*/
|
|
44
|
-
configureScope?: (args:
|
|
45
|
+
configureScope?: (args: ExecutionArgs, scope: Sentry.Scope) => void;
|
|
45
46
|
/**
|
|
46
47
|
* Produces a name of Transaction (only when "renameTransaction" or "startTransaction" are enabled) and description of created Span.
|
|
47
48
|
*
|
|
48
49
|
* @default operation's name or "Anonymous Operation" when missing)
|
|
49
50
|
*/
|
|
50
|
-
transactionName?: (args:
|
|
51
|
+
transactionName?: (args: ExecutionArgs) => string;
|
|
51
52
|
/**
|
|
52
53
|
* Produces tracing data for Transaction
|
|
53
54
|
*
|
|
54
55
|
* @default is empty
|
|
55
56
|
*/
|
|
56
|
-
traceparentData?: (args:
|
|
57
|
+
traceparentData?: (args: ExecutionArgs) => TraceparentData | undefined;
|
|
57
58
|
/**
|
|
58
59
|
* Produces a "op" (operation) of created Span.
|
|
59
60
|
*
|
|
60
61
|
* @default execute
|
|
61
62
|
*/
|
|
62
|
-
operationName?: (args:
|
|
63
|
+
operationName?: (args: ExecutionArgs) => string;
|
|
63
64
|
/**
|
|
64
65
|
* Indicates whether or not to skip the entire Sentry flow for given GraphQL operation.
|
|
65
66
|
* By default, no operations are skipped.
|
|
66
67
|
*/
|
|
67
|
-
skip?: (args:
|
|
68
|
+
skip?: (args: ExecutionArgs) => boolean;
|
|
68
69
|
/**
|
|
69
70
|
* Indicates whether or not to skip Sentry exception reporting for a given error.
|
|
70
71
|
* By default, this plugin skips all `GraphQLError` errors and does not report it to Sentry.
|
|
@@ -72,4 +73,4 @@ export type SentryPluginOptions<PluginContext extends Record<string, any>> = {
|
|
|
72
73
|
skipError?: (args: Error) => boolean;
|
|
73
74
|
};
|
|
74
75
|
export declare const defaultSkipError: typeof isOriginalGraphQLError;
|
|
75
|
-
export declare const useSentry:
|
|
76
|
+
export declare const useSentry: (options?: SentryPluginOptions) => Plugin;
|
package/typings/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExecutionArgs } from 'graphql';
|
|
2
|
+
import { isOriginalGraphQLError, type Plugin } from '@envelop/core';
|
|
2
3
|
import * as Sentry from '@sentry/node';
|
|
3
4
|
import type { TraceparentData } from '@sentry/types';
|
|
4
|
-
export type SentryPluginOptions
|
|
5
|
+
export type SentryPluginOptions = {
|
|
5
6
|
/**
|
|
6
7
|
* Starts a new transaction for every GraphQL Operation.
|
|
7
8
|
* When disabled, an already existing Transaction will be used.
|
|
@@ -37,34 +38,34 @@ export type SentryPluginOptions<PluginContext extends Record<string, any>> = {
|
|
|
37
38
|
/**
|
|
38
39
|
* Adds custom tags to every Transaction.
|
|
39
40
|
*/
|
|
40
|
-
appendTags?: (args:
|
|
41
|
+
appendTags?: (args: ExecutionArgs) => Record<string, unknown>;
|
|
41
42
|
/**
|
|
42
43
|
* Callback to set context information onto the scope.
|
|
43
44
|
*/
|
|
44
|
-
configureScope?: (args:
|
|
45
|
+
configureScope?: (args: ExecutionArgs, scope: Sentry.Scope) => void;
|
|
45
46
|
/**
|
|
46
47
|
* Produces a name of Transaction (only when "renameTransaction" or "startTransaction" are enabled) and description of created Span.
|
|
47
48
|
*
|
|
48
49
|
* @default operation's name or "Anonymous Operation" when missing)
|
|
49
50
|
*/
|
|
50
|
-
transactionName?: (args:
|
|
51
|
+
transactionName?: (args: ExecutionArgs) => string;
|
|
51
52
|
/**
|
|
52
53
|
* Produces tracing data for Transaction
|
|
53
54
|
*
|
|
54
55
|
* @default is empty
|
|
55
56
|
*/
|
|
56
|
-
traceparentData?: (args:
|
|
57
|
+
traceparentData?: (args: ExecutionArgs) => TraceparentData | undefined;
|
|
57
58
|
/**
|
|
58
59
|
* Produces a "op" (operation) of created Span.
|
|
59
60
|
*
|
|
60
61
|
* @default execute
|
|
61
62
|
*/
|
|
62
|
-
operationName?: (args:
|
|
63
|
+
operationName?: (args: ExecutionArgs) => string;
|
|
63
64
|
/**
|
|
64
65
|
* Indicates whether or not to skip the entire Sentry flow for given GraphQL operation.
|
|
65
66
|
* By default, no operations are skipped.
|
|
66
67
|
*/
|
|
67
|
-
skip?: (args:
|
|
68
|
+
skip?: (args: ExecutionArgs) => boolean;
|
|
68
69
|
/**
|
|
69
70
|
* Indicates whether or not to skip Sentry exception reporting for a given error.
|
|
70
71
|
* By default, this plugin skips all `GraphQLError` errors and does not report it to Sentry.
|
|
@@ -72,4 +73,4 @@ export type SentryPluginOptions<PluginContext extends Record<string, any>> = {
|
|
|
72
73
|
skipError?: (args: Error) => boolean;
|
|
73
74
|
};
|
|
74
75
|
export declare const defaultSkipError: typeof isOriginalGraphQLError;
|
|
75
|
-
export declare const useSentry:
|
|
76
|
+
export declare const useSentry: (options?: SentryPluginOptions) => Plugin;
|