【发布时间】:2019-12-09 16:00:29
【问题描述】:
在模拟器上运行。
Error: Network error: Network request failed
at new ApolloError (bundle.umd.js:92)
at Object.error (bundle.umd.js:1323)
at notifySubscription (Observable.js:134)
at onNotify (Observable.js:165)
at SubscriptionObserver.error (Observable.js:224)
at bundle.umd.js:1100
at Set.forEach (<anonymous>)
at Object.error (bundle.umd.js:1099)
at notifySubscription (Observable.js:134)
at onNotify (Observable.js:165)
import ApolloClient, { gql, HttpLink, ApolloLink , concat } from "apollo-boost";
const httpLink = new HttpLink({
uri: 'http://localhost:4000'
});
const client = new ApolloClient({
link: httpLink, //using uri: 'http://localhost:4000' works.
});
"apollo-boost": "^0.4.3",
"react-apollo": "^2.5.8",
"graphql": "^14.4.2",
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
【问题讨论】:
标签: http apollo apollo-client apollo-server app-transport-security