apollographql / apollographql/apollo-client-devtools

"Could not find client" connectToDevTools option is deprecated

Open
#1,678 8 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
172
Avg merge
10m
Merged PRs (30d)
8

Description

**Intended outcome:**

I am trying to configure my apolloClient so that I can use Apollo Client DevTools. However, connectToDevTools option is now deprecated.
```
devtools: {
enabled: true,
},
```
Should be the new option passed into the client object as per [ApolloClient Docs](https://www.apollographql.com/docs/react/api/core/ApolloClient#:~:text=connectToDevTools(optional))

**Actual outcome:**

Ultimately, devTools cannot find the client even when I set if I set
```
if (typeof window !== 'undefined') {
;(window as any).__APOLLO_CLIENT__ = apolloClient
}
```

Making the extension unusable.

![Image](https://github.com/user-attachments/assets/83e5cb52-2171-468d-a181-f14df90ba7fc)

**How to reproduce the issue:**

To reproduce the issue, update to versions mentioned below and Apollo Client (Web) - v3. I am running 3.12.8. Download extension and try to configure your application.

**Desktop (please complete the following information):**

- OS: macOS 14.6.1 (23G93)
- Browser: Chrome
- Browser version: 128.0.6613.120
- Extension version: 4.19.13

Contributor guide

Open the contributing guide

Research direction

Start by locating the repository code that handles the deprecated connectToDevTools option and the newer devtools configuration, then reproduce the report with Apollo Client 3.12.8 and extension 4.19.13. Done means the extension can find the configured client without requiring the deprecated option or manual window assignment.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.