Skip to content

Commit 061cab6

Browse files
authored
Fix incorrect default devtools config (#11969)
1 parent fa3487d commit 061cab6

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.changeset/early-spoons-attack.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/client": patch
3+
---
4+
5+
Remove check for `window.__APOLLO_CLIENT__` when determining whether to connect to Apollo Client Devtools when `connectToDevtools` or `devtools.enabled` is not specified. This now simply checks to see if the application is in development mode.

.size-limits.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"dist/apollo-client.min.cjs": 40179,
3-
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32990
2+
"dist/apollo-client.min.cjs": 40164,
3+
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32977
44
}

src/core/ApolloClient.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,7 @@ export class ApolloClient<TCacheShape> implements DataProxy {
258258
};
259259

260260
if (this.devtoolsConfig.enabled === undefined) {
261-
this.devtoolsConfig.enabled =
262-
typeof window === "object" &&
263-
(window as any).__APOLLO_CLIENT__ &&
264-
__DEV__;
261+
this.devtoolsConfig.enabled = __DEV__;
265262
}
266263

267264
if (ssrForceFetchDelay) {

0 commit comments

Comments
 (0)