Skip to content

Add optional graphqlClientIntegration to @sentry/browser #13399

@mydea

Description

@mydea

Description

Similar to getsentry/sentry-cocoa#3931, we can add a pluggable (=not enabled by default) integration to @sentry/browser (and downstream SDKs) which allows to opt-in to get better breadcrumbs & spans when using GraphQL as a client.

This could behave like this:

Sentry.init({
  integrations: [
    Sentry.graphqlClientIntegration({
      endpoints: ['/graphql'],  
    })
  ]
})

Where any http.client span or breadcrumb created that matches endpoints will be enhanced with graphql data from the request payload:

  1. For http.client spans, we can update the span name similar to what we do here in node: feat(node): Add useOperationNameForRootSpan tographqlIntegration #13248
  2. For breadcrumbs, we can add the operation name to the breadcrumb data (and possibly also the query itself)

related: #13215

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions