New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apollo dev tools 4.0 not showing any data with multiple Apollo Clients #822
Comments
I'm having the same issue with The "Explorer" tab works fine, and executing any queries there will populate the Queries/Cache tabs. However, executing queries in my app does nothing, so does not seem to be listening. |
Actually, it's working for me now. I find that |
Sadly does not work for me.... |
Had the same issue, but noticed that the code was creating multiple apollo clients - if this happens, only the first client is attached to the window as In short - make sure you only create a single apollo client, or if you do create multiple, make sure to assign the one you want to inspect via dev-tools to the window manually. |
This was the missing piece! It looks like you can only watch one Apollo client at a time. Thanks @henrinormak ! |
Just sharing this related stack overflow post that seems to be relating to this issue. https://stackoverflow.com/a/72116931/1880490 |
Have found that "GraphQL Network Inspector" Chrome extension is working nicely |
...actually, I might misunderstood its purpose... |
...and regarding multiple instances of Apollo Client, the client attached to window of my app has "2" in the name: "ApolloClient2"...
|
Hi there, How is useData used? How many places is it used? But before you rewrite anything, could you please help us isolate where the problem might be by going to another site that uses apollo and see whether you see data there? e.g. https://studio.apollographql.com/login should show some queries If you do see data there then we'll know that it's something to do with which instance of apollo client the extension is talking to |
Same problem here, did not work locally, but worked on https://studio.apollographql.com/login. Restarting Chrome helped. |
Had a similar issue while doing local development. The extension didn't work properly when I was accessing my app via |
Hey, how do you check if there are indeed multiple instances of Apollo Client being created? And how do you assign the one you want to be able to inspect in Apollo Devtools? |
I have the same issue even with just one client. I removed all named clients. It's very frustrating not have not working dev tools. Sometime I also have some ghost data from ancient times. So it looks like sometime it works and then breaks and displays old data. It also like the extension doesn't work correctly if apollo client is created "to late". So if you have an SPA and do no create Apollo on initial load it will not show up at all. |
@MrDoomBringer This bug has been outstanding for some time, given your recent exploration into the duplicate queries issue we recently resolved, I was curious if you want to take a look that this one as well. 🙏 cc @bignimbus |
I found the issue in my case. Because of React re-rendering the code, it was executing (and generating) multiple |
@MrDoomBringer @bignimbus This might be an interesting issue to pick up soon for investigation. What do you think? |
@MrDoomBringer let me help you here: |
Recently ran into this issue due to late creation of our apollo client instance. There are also multiple instances across different teams which made utilizing dev tools almost impossible. I was able to fix it by cloning the extension, increasing the timeout it waits for the client to be instantiated and binded dev tools to a unique global variable here in the code
Seems like a more user friendly option would be to provide some configurability and let users bind to a custom variable or to manually execute the binding. |
Hey @johnhok 👋 We are considering a different approach to registering clients with the dev tools at some point. Unfortunately the way the Apollo Client and dev tools communicates is through a single No guarantees on timeline, but I can at least say we are thinking about it! I think it would be super helpful to be able to toggle between the two clients and inspect what each is doing independently. If your fork is working for you now, I'd suggest using that for the time being. I'd prefer not to do much to the current |
hi @johnhok did you end up forking the extension, build it locally then load it as unpacked chrome extension? |
Yep that's exactly what I did. I forked it and did the hacky modifications I mentioned about increasing the timeout and binding to a different global variable. Only the specific apollo client I was interested in gets assigned to that variable. Once you build it with the instructions in the readme you can load it as an unpacked extension like you mentioned. |
@johnhok thank you I plan to do so :), based on the code, it does not seems a "different" global variable is needed though. can just suppress unwanted ones with explicit |
Was happening because next.js renders our app (ui/_app.tsx) twice, and the cache is initialized during that process. This seems to be because of next.js rewrites, and is normal behavior: vercel/next.js#33028 (comment) However, the Apollo dev tools extension doesn't work properly (shows nothing) when multiple apollo clients are created. See: apollographql/apollo-client-devtools#822 (comment)
Was happening because next.js renders our app (ui/_app.tsx) twice, and the cache is initialized during that process. This seems to be because of next.js rewrites, and is normal behavior: vercel/next.js#33028 (comment) However, the Apollo dev tools extension doesn't work properly (shows nothing) when multiple apollo clients are created. See: apollographql/apollo-client-devtools#822 (comment)
Was happening because next.js renders our app (ui/_app.tsx) twice, and the cache is initialized during that process. This seems to be because of next.js rewrites, and is normal behavior: vercel/next.js#33028 (comment) However, the Apollo dev tools extension doesn't work properly (shows nothing) when multiple apollo clients are created. See: apollographql/apollo-client-devtools#822 (comment)
Same issue here. Only one Apollo Client Devtools does not show any data using It does work when using the GraphQL Network Inspector extension, but that does not allow for cache inspection. Any news on this? |
Hey @diogocapela we've done a lot of work recently on the message passing between the client and devtools. Would you give a more recent version of the devtools a shot to see if it has resolved your issue finding the client? If not, feel free to open a new issue and I'd be happy to assist looking further into this :) |
For me it does not work in 4.9.0 |
@adrianwix @diogocapela which version of Apollo Client are you using? Sorry to hear you're blocked on using the extension - as @jerelmiller said, we'd love to get some more info and debug further. Since only one instance of the client is being created, please feel free to open a new issue. And if you're able to create a reproduction in an app we can run locally, that would be tremendously helpful 🙏 |
"@apollo/client": "^3.8.7" @alessbell. |
@adrianwix do you mind creating a separate issue for this? I'd like to track this separately and keep the discussion in that issue so we don't clutter up this one too much 🙂. I'd love to help in any way I can. I think there might be an edge case we aren't handling yet. |
i dont have duplicate instances and i am also getting the same, connectToDevTools: true chrome : Version 124.0.6367.119 (Official Build) (64-bit) |
Intended outcome:
I expect to be able to see the queries data in browser extension.
Actual outcome:
Not showing any data.
How to reproduce the issue:
Install extension in browser.
Desktop (please complete the following information):
The dev tools version is 4, same situation in Chrome as in Firefox. "@apollo/client": "^3.5.7",
The application is React + Vitejs, if it makes any difference... No idea where to start any debuging, please help...
The text was updated successfully, but these errors were encountered: