Closed vacas closed 5 months ago
Yes, that's because you manually pass fetch
into HttpLink which means "take exactly this fetch
" implementation.
This should fix it:
const api1Link = new HttpLink({
uri: 'https://api1.com/',
- fetch,
});
Hey! Thanks for your response, @phryneas 😄
Let me take a closer look into this to confirm if that fixes the problem, and I'll get back to you, yes?
@phryneas, just tested it, and you are absolutely right! That did the trick 🎉
It seems like we were implementing this most likely because we used to have SSR and used to use node-fetch
at some point (this was implemented before our time). Since we moved to Vite recently, we don't need this implementation anymore, and this was just an oversight on our part.
Thanks for the quick response! Cheers 🍻
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.
Original Issue
Originally posted by @phryneas in https://github.com/apollographql/apollo-client/issues/7130#issuecomment-1867580404
Hello! 👋🏻
I recently came across this issue in my code where we were initializing the Apollo Client before initializing the DataDog RUM package. I was able to fix this by moving the DataDog initialization higher up in the tree (in the same file as where the
render(...)
function is used), but I thought I would call it out here. I'll add some pseudo-code samples since this is hard to reproduce without a public DataDog account.Package versions:
Code Sample
ApolloClientProvider.jsx
DataDogRumProvider.jsx
Application.jsx
With this implementation, you should see that none of the
x-datadog-*
headers are present in the request header of any of the GraphQL requests, and I believe it is very tied to what was highlighted in https://github.com/apollographql/apollo-client/issues/7130.Let me know if you need any additional details, yes?
Cheers!