当我试图导入‘阿波罗-链接-http’时,我在使用webpack捆绑文件时出错。Webpack正在投掷:
“未找到模块:错误:无法解决'/home/pankaj/Openworld/play Projects/admin-portal/app/frontend/node_modules/apollo-link-http/lib‘’中的‘导入’”
import { ApolloClient } from 'apollo-client';
import gql from 'graphql-tag';
import { HttpLink } from 'apollo-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloProvider } from 'react-apollo';
const client = new ApolloClient({
link: new HttpLink({ uri: 'https://q80vw8qjp.lp.gql.zone/graphql'}),
cache: new InMemoryCache()
});发布于 2017-11-29 12:29:44
尝试使用createHttpLink或更新apollo-link-http依赖项。
import { createHttpLink } from "apollo-link-http";
const client = new ApolloClient({
link: createHttpLink({ uri: https://q80vw8qjp.lp.gql.zone/graphql" });
cache: new InMemoryCache()
});https://stackoverflow.com/questions/47552640
复制相似问题