我正在尝试订阅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
})
答案 0 :(得分:1)
原因是错误的名称。
apolloClient.subscribe
解决了我的问题