Giter VIP home page Giter VIP logo

Comments (7)

DiederikvandenB avatar DiederikvandenB commented on July 24, 2024

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.

rmlevangelio avatar rmlevangelio commented on July 24, 2024

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.

DiederikvandenB avatar DiederikvandenB commented on July 24, 2024

Which version of the apollo packages are you using, and which version of this package?

from apollo-link-sentry.

rmlevangelio avatar rmlevangelio commented on July 24, 2024

@DiederikvandenB I'm using "@apollo/client": "^3.2.9", and "apollo-link-sentry": "^2.0.1",

from apollo-link-sentry.

DiederikvandenB avatar DiederikvandenB commented on July 24, 2024

Strange, from my tests everything seems to work. It seems like an environmental issue.

from apollo-link-sentry.

rmlevangelio avatar rmlevangelio commented on July 24, 2024

This only happens when deployed to CI/CD. I'll investigate further then

from apollo-link-sentry.

DiederikvandenB avatar DiederikvandenB commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.