【问题标题】:GraphiQL subscriptions working with subscriptions-transport-ws 0.7.3, but not 0.8.2GraphiQL 订阅使用 subscriptions-transport-ws 0.7.3,但不是 0.8.2
【发布时间】:2017-09-07 21:53:08
【问题描述】:

我有一个 nodejs GraphQL 应用程序运行以下

"graphql": "^0.10.5",
"graphql-errors": "^2.1.0",
"graphql-server-core": "^1.1.0",
"graphql-server-express": "^1.1.0",
"graphql-server-module-graphiql": "^1.1.0",
"graphql-subscriptions": "^0.4.4",
"graphql-tools": "^1.2.1",
"subscriptions-transport-ws": "^0.7.3",

使用此配置,我可以在 graphiql 中定义订阅,并观察结果出现在输出窗格中,替换样板消息 "Your subscription data will appear here after server publication!"

如果我切换到最新版本的订阅-transport-ws,即

"subscriptions-transport-ws": "^0.8.2",

这不再有效;样板消息没有出现在输出窗格中,而是我收到了神秘的 [object] [object] 消息。

我找不到任何关于 graphiql 和 subscriptions-transport-ws 之间版本兼容性的声明;有谁知道这个版本组合是否支持?

【问题讨论】:

  • 你有没有在susbcriptions-transport-ws repo 上提出过问题和/或尝试过二等分来找出哪个提交改变了这个?

标签: subscriptions graphiql


【解决方案1】:

我通过在 package.json 中恢复到以下库的这些版本解决了 graphiql 中的 [Object Object] 错误: "graphql-subscriptions": "^0.4.3", "graphql-tools": "^1.0.0", "subscriptions-transport-ws": "0.7.3",

【讨论】:

    猜你喜欢
    • 2017-02-07
    • 2018-05-11
    • 2020-11-12
    • 2022-09-29
    • 2021-11-09
    • 1970-01-01
    • 2019-07-12
    • 1970-01-01
    • 2022-10-14
    相关资源
    最近更新 更多