Tip for using it with Apollo 1.x
Just leaving this hear in case someone has the same issue as me getting it to work with Apollo 1.x:
Copy this file to somewhere in your project: https://github.com/cpunion/react-native-actioncable/blob/master/index.js
And then after global.document add the following line:
global.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ = ''
if(Platform.OS == 'ios' || Platform.OS == 'android'){
global.document = {
addEventListener () {},
removeEventListener () {}
}
global.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ = ''
}
The problem is that once there is a document, apollo checks for devtools meant for the browser and checks if global.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ is undefined, then tries to give you some suggestions what devtools to use, but fails because there is no navigator.userAgent. So by just setting it to an empty string you skip the suggestion.
Very useful. Thanks.
This is a problem in Apollo 2 as well.