Comments (7)
Could you perhaps provide some code? As is explained in the readme, the following should work:
import { SentryLink } from 'apollo-link-sentry';
const client = new ApolloClient({
link: ApolloLink.from([
new SentryLink(/* See options */),
new HttpLink({ uri: 'http://localhost:4000' }),
]),
cache: new InMemoryCache(),
});
from apollo-link-sentry.
I have same implementation. I just importing all links from different files:
import { from, ApolloClient, InMemoryCache } from '@apollo/client';
import { contextLink, errorLink, httpLink, sentryLink } from './middlewares';
let apolloClient = null;
const memoryCache = new InMemoryCache();
export const createApolloClient = history => {
apolloClient = new ApolloClient({
link: from([contextLink, errorLink(history), sentryLink, httpLink]),
cache: memoryCache,
});
return apolloClient;
};
export const getApolloClient = () => apolloClient;
Middlewares.ts
export * from './http';
export * from './error';
export * from './context';
export * from './sentry';
and my sentryLink file is this:
import { SentryLink } from 'apollo-link-sentry';
export const sentryLink = new SentryLink({
breadcrumb: {
enable: true,
includeQuery: true,
includeError: true,
},
});
If I put sentryLink
AFTER httpLink
, there will be no events triggered since httpLink
is a terminating link. But right now, if I add it before, my application is not triggering graphql api requests when network error is thrown.
from apollo-link-sentry.
Which version of the apollo packages are you using, and which version of this package?
from apollo-link-sentry.
@DiederikvandenB I'm using "@apollo/client": "^3.2.9",
and "apollo-link-sentry": "^2.0.1",
from apollo-link-sentry.
Strange, from my tests everything seems to work. It seems like an environmental issue.
from apollo-link-sentry.
This only happens when deployed to CI/CD. I'll investigate further then
from apollo-link-sentry.
Let me know if it's anything related to the package, in which case I will reopen the issue. Good luck with your debugging efforts.
from apollo-link-sentry.
Related Issues (20)
- Question: Possible to only attach breadcrumbs when an error occurs? HOT 1
- Question: recommended way to limit size of breadcrumbs? HOT 1
- excludeGraphQLFetch should remove unsupported fragment definitions HOT 2
- Maintainership of this package HOT 8
- Test usage with subscriptions HOT 3
- Test usage with `apollo-link-error` HOT 2
- Missing dependencies on NextJS build
- Add sentry-trace header HOT 4
- Newest version breaks with react-native HOT 2
- Severity is undefined HOT 4
- Create-React-App warns about missing SourceMap HOT 1
- Remove peer dependencies HOT 1
- Importing apollo-link-sentry package gives 350kb of unwanted and unused code. HOT 5
- Transform function can change response for downstream links HOT 2
- Missing Typescript types for zen-observable in non-dev installation HOT 2
- Remove specific param from gql mutations HOT 1
- Enable `apollo-link-sentry` tree-shaking via ESM HOT 1
- Add the "@sentry/browser" package to the dependencies section in your package.json file, not in devDependencies HOT 3
- Can't use package without supporting esnext
- Sentry v8 compatibility HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-link-sentry.