Skip to content

GraphQL Client Integration for React Native - Sentry.graphqlClientIntegration #5271

@Martinocom-Switcho

Description

@Martinocom-Switcho

Problem Statement

With #13783 a GraphQL Client Integration was added to Sentry Browser. I was interested in using it also with our React Native application, but the package itself it's not available in React Native integration list. It's not even mentioned in documentation.

I would like to have the possibility to use the GraphQL Client Integration for React Native.

Solution Brainstorm

In our Expo RN project I actually tried to import the integration directly from browser and then using it.

import { graphqlClientIntegration } from '@sentry/browser';

// ...

Sentry.init({
    integrations: [
      // ...
      graphqlClientIntegration({ endpoints: [/* My awesome endpoint */] })
    ],
    // ...
})

To my surprise it actually worked. I'm not sure if importing from @sentry/browser is a good idea tho.

Exploring the codebase, Sentry for React Native actually imports from @sentry/browser some integrations (packages/core/src/js/index.js, line 65) in order to export them again, but GraphQL is not one of them. Why?

Are you willing to submit a PR?

None

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions