apollo-link-sentry
Version:
[Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction) to enrich [Sentry](https://sentry.io) events with [GraphQL](https://graphql.org) data
25 lines (24 loc) • 865 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.excludeGraphQLFetch = void 0;
exports.withoutGraphQLFetch = withoutGraphQLFetch;
var excludeGraphQLFetch = function (breadcrumb) {
var _a, _b;
if (breadcrumb.category === 'fetch') {
var url = (_b = (_a = breadcrumb.data) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : '';
if (url.includes('/graphql')) {
return null;
}
}
return breadcrumb;
};
exports.excludeGraphQLFetch = excludeGraphQLFetch;
function withoutGraphQLFetch(beforeBreadcrumb) {
return function (breadcrumb, hint) {
var withoutFetch = (0, exports.excludeGraphQLFetch)(breadcrumb, hint);
if (withoutFetch === null) {
return null;
}
return beforeBreadcrumb(withoutFetch, hint);
};
}