关于将React Apollo 1.x迁移到2.x的问题

时间:2019-07-12 07:53:58

标签: reactjs graphql react-apollo

将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>,
);

任何人都可以提供解决方案

Added error screen shot

0 个答案:

没有答案