Skip to content
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

Disable "Download the Apollo DevTools for a better development experience" warning #382

Open
mydea opened this issue Jan 12, 2021 · 2 comments

Comments

@mydea
Copy link
Contributor

mydea commented Jan 12, 2021

This is caused by an upstream change I guess, but I now get this console log:

 LOG: Download the Apollo DevTools for a better development experience: https://...

Both in development as well as in my test output. I have googled a bit but not found a way to disable it so far... I tried adding this to my tests/index.html:

 <script>
      __REACT_DEVTOOLS_GLOBAL_HOOK__ = true;
    </script>

And also setting connectToDevTools: false in my tests, but still get the message. Would be great to find a way to disable this message!

@mstuercke
Copy link

Just use __APOLLO_DEVTOOLS_GLOBAL_HOOK__ instead.

I was searching the library for a switch and finally found it in line 209 in the ApolloClient.ts, wich checks for !(window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__

I added this line to my index.tsx
window['__APOLLO_DEVTOOLS_GLOBAL_HOOK__'] = true

@mydea
Copy link
Contributor Author

mydea commented Jun 17, 2021

Nice! I guess this could maybe be handled by this addon as well (?), but for now I can add it manually to my app.js as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants