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

Is it possible to disable DevTools message?

Open RIP21 opened this issue 1 year ago • 1 comments

Download the Apollo DevTools for a better development experience: https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/

I'm running a fully functioning Apollo Client in my tests (as I'm using MSW for testing https://mswjs.io/) and I have this annoying message in the stdout above. Is it possible to disable it?

RIP21 avatar Sep 12 '22 16:09 RIP21

@RIP21 👋 Thanks for asking about this. We'll definitely consider if this message is useful or annoying to people. In your case it sounds like it's less useful. 😄

For reference The block of code that controls this seems to be here

jpvajda avatar Sep 20 '22 21:09 jpvajda

Wondering from what place __DEV__ is coming :) Aaaanyway, I'll probably patch that line of code using pnpm patch (if you using other package manager you can use patch-package package)

RIP21 avatar Oct 01 '22 23:10 RIP21

Another hack is to set in the setupTests.ts e.g. your global test file however it's named

globalThis.__DEV__ = false

You would like to ignore the TS issue with that obviously :)

RIP21 avatar Oct 15 '22 00:10 RIP21

@jpvajda @RIP21 Hello, I put a fix. I think use header will be a good solution for this issue. Please review the PR and let me know if it works

@jpvajda please let me know if you want me ignore the prettier style change

chris110408 avatar Nov 02 '22 04:11 chris110408

@chris110408 thanks for the PR chris! We'll take a look at this and see if we can get it merged in soon. cc @MrDoomBringer / @bignimbus

jpvajda avatar Nov 02 '22 15:11 jpvajda