apolloClient.subsribe 未定义

Posted

技术标签:

【中文标题】apolloClient.subsribe 未定义【英文标题】:apolloClient.subsribe is undefined 【发布时间】:2017-09-23 11:58:32 【问题描述】:

我正在尝试订阅 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】:

原因是因为名字不对。

apolloClient.subscribe 解决了我的问题

【讨论】:

以上是关于apolloClient.subsribe 未定义的主要内容,如果未能解决你的问题,请参考以下文章

“注意:未定义的变量”、“注意:未定义的索引”、“警告:未定义的数组键”和“注意:未定义的偏移量”使用 PHP

“注意:未定义的变量”、“注意:未定义的索引”、“警告:未定义的数组键”和“注意:未定义的偏移量”使用 PHP

idea thymeleaf 变量未定义

“注意:未定义的变量”、“注意:未定义的索引”和“注意:未定义的偏移量”使用 PHP

“注意:未定义的变量”、“注意:未定义的索引”和“注意:未定义的偏移量”使用 PHP

“注意:未定义的变量”、“注意:未定义的索引”和“注意:未定义的偏移量”使用 PHP