Registry / monitoring / apollo-sentry-link

apollo-sentry-link

JSON →
library1.3.0jsnpmunverified

An Apollo Link that records GraphQL queries as Sentry breadcrumbs for debugging. Current stable version is 1.3.0, with infrequent releases. It logs query names, types (query/mutation), and fragment names as breadcrumbs in Sentry (or console in development). Lightweight alternative to custom Apollo link integration, depends on @sentry/minimal and @apollo/client.

npm install apollo-sentry-link
INSTALL
IMPORT
SIG · APOLLO-SENTRY-LINK
A
apollo-sentry-link
monitoringjavascriptv1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ApolloSentryLink
import ApolloSentryLink from 'apollo-sentry-link'
import { ApolloSentryLink } from 'apollo-sentry-link'
Default export only; named import will not work.

Creates an Apollo Client with the Sentry link to record GraphQL queries as breadcrumbs.

import { ApolloClient, ApolloLink, createHttpLink } from '@apollo/client'; import ApolloSentryLink from 'apollo-sentry-link'; const client = new ApolloClient({ link: ApolloLink.from([ ApolloSentryLink, createHttpLink({ uri: process.env.GRAPHQL_URI ?? '/graphql' }) ]) });
Debug
Known issues
gotchaIn development mode, logs to console instead of sending to Sentry.
fix
No fix needed; intended behavior for debugging.
affects: >=1.0.0
gotchaOnly records query name, type, and fragment names; does not capture variables or errors.
fix
Extend the link or use Sentry's manual breadcrumb API for more details.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'apollo-sentry-link'
Package not installed or incorrect import path.
fix
npm install apollo-sentry-link
TypeError: ApolloSentryLink is not a function
Using named import instead of default import.
fix
Change import to: import ApolloSentryLink from 'apollo-sentry-link'
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies
@sentry/minimalrequiredRequired to capture breadcrumbs in Sentry
@apollo/clientrequiredPeer dependency for Apollo Link interface
Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
1
Resources
apollo-sentry-link — npm install apollo-sentry-link · libregistry