There is an issue with fetch in React Native that prevents the usage of `localhost`. A proposed solution is to use `Platform.select` to set the ApolloClient's `HttpLink` uri to one of several options: ``` const SERVER_URL = __DEV__ ? Platform.select({ ios: 'GET_USERS_IP_ADDRESS_AND_APPEND_PORT_4000', android: 'http://10.0.2.2:4000' }) : 'USE_PRODUCTION_GRAPHQL_SERVER_ENV_VAR'; ``` Android apparently allows 10.0.2.2 to equal localhost, but I haven't confirmed this myself.
There is an issue with fetch in React Native that prevents the usage of
localhost.A proposed solution is to use
Platform.selectto set the ApolloClient'sHttpLinkuri to one of several options:Android apparently allows 10.0.2.2 to equal localhost, but I haven't confirmed this myself.