apollographql / apollo-client-devtools

Apollo Client browser developer tools.
https://apollographql.com/docs/react/development-testing/developer-tooling/#apollo-client-devtools
MIT License
1.48k stars 165 forks source link

Use the tool on a React Native project without Flipper or react-native-debugger app #1420

Open fabiendem opened 2 months ago

fabiendem commented 2 months ago

Intended outcome:

I want to use the Apollo Client Devtools in a React Native project, without Flipper or the React Native Debugger (https://github.com/jhen0409/react-native-debugger).

https://github.com/jhen0409/react-native-debugger is gradually losing love from the RN community because Flipper was the go to solution. Now Flipper is getting replaced with an integrated Chrome debugger.

Actual outcome:

I have added the extension to my browser, but without much surprise, it doesn't connect to my react native app. I'm curious if I am missing something, or if it's not possible for now.

Thank you!

How to reproduce the issue:

Desktop (please complete the following information):

jerelmiller commented 2 months ago

Hey @fabiendem 👋

I'm a bit unfamiliar with any of the RN debuggers as I've not worked much with React Native, but cool to hear an integrated Chrome debugger is there.

The devtools work by relying on the client instance setting window.__APOLLO_CLIENT__ to itself when connectToDevTools is true. Is the RN app a remote instance? Perhaps check to see if window.__APOLLO_CLIENT__ is getting set in the browser?

I'll have to dig into the specifics of how the Chrome debugger and RN work together, but I'm afraid I have some other priorities at the moment so I can't commit to anything yet.

fabiendem commented 2 months ago

Hey @jerelmiller, Thank you, ok understood 👍

Here are some interesting links FYI:

I am also clueless about how the debugger is connected to the app. I will ask over there if they can provide any guidance.

fabiendem commented 2 months ago

Asked at https://github.com/react-native-community/discussions-and-proposals/discussions/733#discussioncomment-9894320

jerelmiller commented 2 months ago

Appreciate the links! This is helpful.

fabiendem commented 2 months ago

cc https://github.com/react-native-community/discussions-and-proposals/discussions/733#discussioncomment-9904398