apolloClient.subsribe未定义

时间:2017-04-26 07:54:51

标签: apollo graphql-subscriptions

我正在尝试订阅apollo,我收到了以下错误

apolloClient.Subsribe is undefined

附加我的客户端订阅

const networkInterface = createNetworkInterface('http://localhost:8000/graphql');

const wsClient = new SubscriptionClient(`ws://localhost:8000/`, {
                 reconnect: true,
                 connectionParams: {
                 }
}); 

const networkInterfaceWithSubscriptions = addGraphQLSubscriptions(networkInterface,wsClient);


const apolloClient = new ApolloClient({
    networkInterface: networkInterfaceWithSubscriptions
})

1 个答案:

答案 0 :(得分:1)

原因是错误的名称。

apolloClient.subscribe解决了我的问题