【发布时间】:2018-04-17 00:33:44
【问题描述】:
我正在尝试将 graphql 与我的 vue 项目集成。 我正在遵循这些说明:https://github.com/Akryum/vue-apollo
我已按要求安装了 npm 'apollo-client',但由于某种原因我无法导入 'createBatchingNetworkInterface'。
这是我的 main.js 文件:
import Vue from 'vue'
import { ApolloClient, createBatchingNetworkInterface } from 'apollo-client'
import VueApollo from 'vue-apollo'
import App from './App'
import router from './router'
这是我的 apollo-client 的 index.d.ts 文件:
export { print as printAST } from 'graphql/language/printer';
export { ObservableQuery, FetchMoreOptions, UpdateQueryOptions, ApolloCurrentResult } from './core/ObservableQuery';
export { WatchQueryOptions, MutationOptions, SubscriptionOptions, FetchPolicy, FetchMoreQueryOptions, SubscribeToMoreOptions, MutationUpdaterFn } from './core/watchQueryOptions';
export { NetworkStatus } from './core/networkStatus';
export * from './core/types';
export { ApolloError } from './errors/ApolloError';
import ApolloClient, { ApolloClientOptions } from './ApolloClient';
export { ApolloClientOptions };
export { ApolloClient };
export default ApolloClient;
我在这里看不到“createBatchingNetworkInterface”所需的对象。
我不知道我在这里做错了什么。
【问题讨论】:
标签: node.js vue.js graphql apollo apollo-client