Skip to content

Commit

Permalink
Ensure connectToDevtools: null is backwards compatible
Browse files Browse the repository at this point in the history
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
  • Loading branch information
jerelmiller and phryneas committed Jul 9, 2024
1 parent 684b9fc commit e7631ca
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/core/ApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,14 @@ export class ApolloClient<TCacheShape> implements DataProxy {
this.typeDefs = typeDefs;
this.devtoolsConfig = {
...devtools,
enabled:
devtools?.enabled ??
connectToDevTools ??
(typeof window === "object" &&
(window as any).__APOLLO_CLIENT__ &&
__DEV__),
enabled: devtools?.enabled || connectToDevTools,
};
if (this.devtoolsConfig.enabled === undefined) {
this.devtoolsConfig.enabled =
typeof window === "object" &&
(window as any).__APOLLO_CLIENT__ &&
__DEV__;
}

if (ssrForceFetchDelay) {
setTimeout(
Expand Down

0 comments on commit e7631ca

Please sign in to comment.