Skip to content
pubscout

sentry_link

10.5.0, released 3 days ago by sentry.io

Automatic capture of exceptions and GraphQL errors for the gql ecosystem like graphql and ferry.

WASM-readyRock solid
$ flutter pub add sentry_link
Source repository

What it does

SentryLink integrates with the gql ecosystem (such as graphql and ferry) to automatically capture exceptions, GraphQL errors, and performance traces for requests. It helps improve exception reporting through custom extractors and provides serialization/parsing tracing for HttpLink and DioLink.

AI-written summary of version 10.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using the gql ecosystem (graphql, ferry, artemis) in your Dart or Flutter application
  • You want to automatically report GraphQL errors and exceptions to Sentry
  • You want performance monitoring and tracing for GraphQL requests and serialization

Skip it when

  • You are not using Sentry for error tracking or performance monitoring
  • You are not using the gql package ecosystem for network requests

Strengths

  • Seamless integration with popular GraphQL packages like graphql, ferry, and artemis
  • Supports performance monitoring and tracing for serialization and parsing
  • Provides tools to filter redundant HTTP breadcrumbs

Weaknesses

  • Tied strictly to Sentry and the gql package ecosystem

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
5

Add SentryGql.link() to your GraphQL link chain and optionally configure exception extractors in Sentry.init.

final link = Link.from([
    AuthLink(getToken: () async => 'Bearer $personalAccessToken'),
    SentryGql.link(
      shouldStartTransaction: true,
      graphQlErrorsMarkTransactionAsFailed: true,
    ),
    HttpLink('https://api.github.com/graphql'),
]);

Alternatives

Packages that do the same job and could replace sentry_link.

  • ferry

    A GraphQL client for Dart and Flutter with code generation and normalized caching.

  • ferry_flutter

    Flutter widgets for executing GraphQL operations using the ferry client

  • gql_websocket_link

    GraphQL WebSocket link for executing queries, mutations, and subscriptions.

  • ferry_generator

    A Dart code generator to create fully typed OperationRequests for the ferry GraphQL client.

Works with

Packages commonly used together with sentry_link: ones it builds on, ones built on it, and its own family.