将React Apollo从1.0迁移到2.x时遇到问题
显示意外错误
const httpLink = createHttpLink({uri: 'http://10.0.0.20:3004/graphql'});
const middlewareLink = setContext(() => ({
headers: {
'session-id': cookies.get('sessionToken')
}
}));
const client = new ApolloClient({
// fragmentMatcher: fm,
link: from([httpLink, middlewareLink]),
cache: new InMemoryCache(),
});
ReactDOM.render(
<LocaleProvider locale={enUS}>
<ApolloProvider client={client}>
<Provider store={store}>
<Router history={browserHistory}>{routes}</Router>
</Provider>
</ApolloProvider>
</LocaleProvider>,
);
任何人都可以提供解决方案