File tree Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Original file line number Diff line number Diff line change 1010
1111### Features
1212
13+ - Adds GraphQL integration ([ #5299 ] ( https://github.com/getsentry/sentry-react-native/pull/5299 ) )
1314- Add new _ experimental_ Canvas Capture Strategy for Session Replay ([ #5301 ] ( https://github.com/getsentry/sentry-react-native/pull/5301 ) )
1415 - A new screenshot capture strategy that uses Android's Canvas API for more accurate and reliable text and image masking
1516 - Any .drawText() or .drawBitmap() calls are replaced by rectangles, ensuring no text or images are present in the resulting output
2728 });
2829 ```
2930
30-
3131### Dependencies
3232
3333- Bump Bundler Plugins from v4.4 .0 to v4.5 .0 ([#5283 ](https: // github.com/getsentry/sentry-react-native/pull/5283))
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export { timeToDisplayIntegration } from '../tracing/integrations/timeToDisplayI
2525export { breadcrumbsIntegration } from './breadcrumbs' ;
2626export { primitiveTagIntegration } from './primitiveTagIntegration' ;
2727export { logEnricherIntegration } from './logEnricherIntegration' ;
28+ export { graphqlIntegration } from './graphql' ;
2829
2930export {
3031 browserApiErrorsIntegration ,
Original file line number Diff line number Diff line change 1+ import { graphqlClientIntegration as browserGraphqlClientIntegration } from '@sentry/browser' ;
2+ import type { Integration } from '@sentry/core' ;
3+
4+ interface GraphQLReactNativeIntegrationOptions {
5+ endpoints : Array < string | RegExp > ;
6+ }
7+
8+ /**
9+ * This integration ensures that GraphQL requests made in the React Native apps
10+ * have their GraphQL-specific data captured and attached to spans and breadcrumbs.
11+ */
12+ export function graphqlIntegration ( options : GraphQLReactNativeIntegrationOptions ) : Integration {
13+ return browserGraphqlClientIntegration ( { endpoints : options . endpoints } ) ;
14+ }
Original file line number Diff line number Diff line change 1+ import { graphqlClientIntegration as browserGraphqlClientIntegration } from '@sentry/browser' ;
2+ import { graphqlIntegration } from '../../src/js' ;
3+
4+ jest . mock ( '@sentry/browser' , ( ) => ( {
5+ graphqlClientIntegration : jest . fn ( ( ) => ( { name : 'GraphQL' } ) ) ,
6+ } ) ) ;
7+
8+ describe ( 'GraphQL Integration' , ( ) => {
9+ afterEach ( ( ) => {
10+ jest . resetAllMocks ( ) ;
11+ } ) ;
12+
13+ it ( 'passes React Native options to browserGraphqlClientIntegration' , ( ) => {
14+ const result = graphqlIntegration ( { endpoints : [ 'test' ] } ) ;
15+
16+ expect ( browserGraphqlClientIntegration ) . toHaveBeenCalledWith ( {
17+ endpoints : [ 'test' ] ,
18+ } ) ;
19+ expect ( result ) . toBeDefined ( ) ;
20+ } ) ;
21+
22+ it ( 'handles RegExp patterns' , ( ) => {
23+ const pattern = / g r a p h q l / ;
24+ graphqlIntegration ( { endpoints : [ pattern ] } ) ;
25+
26+ expect ( browserGraphqlClientIntegration ) . toHaveBeenCalledWith ( {
27+ endpoints : [ pattern ] ,
28+ } ) ;
29+ } ) ;
30+ } ) ;
You can’t perform that action at this time.
0 commit comments