ember-apollo-client icon indicating copy to clipboard operation
ember-apollo-client copied to clipboard

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

Open mydea opened this issue 4 years ago • 2 comments

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!

mydea avatar Jan 12 '21 10:01 mydea

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

mstuercke avatar Jun 17 '21 10:06 mstuercke

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!

mydea avatar Jun 17 '21 15:06 mydea