# Client Stacktraces

**URL:** <https://community.apollographql.com/t/client-stacktraces/6765>\
**Category:** Client SDKs\
**Tags:** client\
**Created:** [September 26, 2023, 1:37am UTC](https://community.apollographql.com/t/client-stacktraces/6765 "2023-09-26T01:37:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmaclean](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/mmaclean/32/4616_2.png) [@mmaclean](https://community.apollographql.com/u/mmaclean)\
**Post date:** [September 26, 2023, 1:37am UTC](https://community.apollographql.com/t/client-stacktraces/6765/1 "2023-09-26T01:37:42Z")

</div>

When handling a graphQL error in the client, it’s useful to be able to understand in a large system where the issue came from. When using the [Error Link](https://www.apollographql.com/docs/react/data/error-handling/#advanced-error-handling-with-apollo-link), you can access stacktrace information from the ApolloServer, but I want to be able to see call-site information from the client. Ideally to send to Sentry.

In ApolloClient links, creating a stacktrace and logging it will only return the stacktrace of the Apollo link system, which is not particularly helpful.  
e.g.

```auto
    const testLink = setContext(() => {
      const err = new Error();
      console.log('IM HERE', err.stack);
      return {};
    });
    return new ApolloClient({
      link: ApolloLink.from([testLink, errorLink]),
   }

```

```auto
IM HERE createApolloClient/testLink<@webpack-internal:///./src/services/ApolloService.ts:56:25
setContext/</</<@webpack-internal:///../node_modules/@apollo/client/link/context/index.js:18:47

```

It’s possible to log the name of the GraphQL query, which is helpful when all queries have a unique name, but unfortunately that is not the case in our large codebase.

Is there a way to add the location of where the graphQL query originated from within the client to the error log in the ApolloClient error link? Or am I just approaching this incorrectly?

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/client-stacktraces/6765/2 "2025-02-06T20:48:19Z")

</div>

Archived on February 6, 2025, 8:48pm UTC


