File tree Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -8,17 +8,17 @@ import { Severity } from '@sentry/types';
8
8
import Observable from 'zen-observable' ;
9
9
10
10
import { GraphQLBreadcrumb , makeBreadcrumb } from './breadcrumb' ;
11
- import { ApolloLinkSentryOptions , Options , withDefaults } from './options' ;
11
+ import { FullOptions , SentryLinkOptions , withDefaults } from './options' ;
12
12
import {
13
13
attachBreadcrumbToSentry ,
14
14
setFingerprint ,
15
15
setTransaction ,
16
16
} from './sentry' ;
17
17
18
18
export class SentryLink extends ApolloLink {
19
- private readonly options : ApolloLinkSentryOptions ;
19
+ private readonly options : FullOptions ;
20
20
21
- constructor ( options : Options = { } ) {
21
+ constructor ( options : SentryLinkOptions = { } ) {
22
22
super ( ) ;
23
23
this . options = withDefaults ( options ) ;
24
24
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import dotProp from 'dot-prop';
4
4
import { print } from 'graphql' ;
5
5
6
6
import { extractDefinition } from './operation' ;
7
- import { ApolloLinkSentryOptions , AttachBreadcrumbsOptions } from './options' ;
7
+ import { FullOptions , AttachBreadcrumbsOptions } from './options' ;
8
8
9
9
export interface BreadcrumbData {
10
10
url ?: string ;
@@ -23,7 +23,7 @@ export interface GraphQLBreadcrumb extends SentryBreadcrumb {
23
23
24
24
export function makeBreadcrumb (
25
25
operation : Operation ,
26
- options : ApolloLinkSentryOptions ,
26
+ options : FullOptions ,
27
27
) : GraphQLBreadcrumb {
28
28
// We validated this is set before calling this function
29
29
const attachBreadcrumbs = options . attachBreadcrumbs as AttachBreadcrumbsOptions ;
Original file line number Diff line number Diff line change 1
1
export { SentryLink } from './SentryLink' ;
2
- export { Options } from './options' ;
2
+ export { SentryLinkOptions } from './options' ;
3
3
export { GraphQLBreadcrumb } from './breadcrumb' ;
4
4
export {
5
5
excludeGraphQLFetch ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { GraphQLBreadcrumb } from './breadcrumb';
6
6
7
7
export type NonEmptyArray < T > = [ T , ...Array < T > ] ;
8
8
9
- export interface ApolloLinkSentryOptions {
9
+ export interface FullOptions {
10
10
/**
11
11
* Determines if the given operation should be handled or discarded.
12
12
*
@@ -121,13 +121,13 @@ export const defaultOptions = {
121
121
} ,
122
122
} as const ;
123
123
124
- export function withDefaults ( options : Options ) : ApolloLinkSentryOptions {
124
+ export function withDefaults ( options : SentryLinkOptions ) : FullOptions {
125
125
return deepMerge ( defaultOptions , options ) ;
126
126
}
127
127
128
- export type Options = Partial <
128
+ export type SentryLinkOptions = Partial <
129
129
Pick <
130
- ApolloLinkSentryOptions ,
130
+ FullOptions ,
131
131
'shouldHandleOperation' | 'uri' | 'setTransaction' | 'setFingerprint'
132
132
>
133
133
> & {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Scope } from '@sentry/types';
4
4
5
5
import { GraphQLBreadcrumb } from './breadcrumb' ;
6
6
import { extractDefinition } from './operation' ;
7
- import { ApolloLinkSentryOptions } from './options' ;
7
+ import { FullOptions } from './options' ;
8
8
9
9
export function setTransaction ( operation : Operation ) : void {
10
10
const definition = extractDefinition ( operation ) ;
@@ -33,7 +33,7 @@ export function setFingerprint(operation: Operation): void {
33
33
export function attachBreadcrumbToSentry (
34
34
operation : Operation ,
35
35
breadcrumb : GraphQLBreadcrumb ,
36
- options : ApolloLinkSentryOptions ,
36
+ options : FullOptions ,
37
37
) : void {
38
38
if (
39
39
options . attachBreadcrumbs &&
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { GraphQLError, parse } from 'graphql';
5
5
import sentryTestkit from 'sentry-testkit' ;
6
6
import Observable from 'zen-observable' ;
7
7
8
- import { GraphQLBreadcrumb , SentryLink , Options } from '../src' ;
8
+ import { GraphQLBreadcrumb , SentryLink , SentryLinkOptions } from '../src' ;
9
9
import { DEFAULT_FINGERPRINT } from '../src/sentry' ;
10
10
11
11
const { testkit, sentryTransport } = sentryTestkit ( ) ;
@@ -58,7 +58,7 @@ describe('SentryLink', () => {
58
58
} ) ;
59
59
60
60
it ( 'should attach a breadcrumb for each apolloOperation' , ( done ) => {
61
- const includeErrorAndResultOptions : Options = {
61
+ const includeErrorAndResultOptions : SentryLinkOptions = {
62
62
attachBreadcrumbs : { includeResult : true , includeError : true } ,
63
63
} ;
64
64
You can’t perform that action at this time.
0 commit comments