您如何配置简单订阅以使用 Postgraphile CLI 运行?

问题描述

我想将订阅添加到我目前使用通过运行 postgraphile 创建的端口 5000 端点引用 graphql 的反应项目中。我使用全局安装(通过 npm -g postgraphile)postgraphile 的命令行启动来启动它。这工作正常。

通过文档 (https://www.graphile.org/postgraphile/subscriptions/) 我看到我应该能够通过 CLI 启用订阅:- https://www.graphile.org/postgraphile/subscriptions/#enabling-with-the-cli-1

但是,当我运行此程序时,出现错误:- “错误:找不到模块‘--simple-subscriptions’

我不确定这是否与 pg-pubsub 有关。当我在全球安装 postgraphile 时,我对 pg-pubsub 也做了同样的事情。因此,而不是:-
postgraphile --plugins @graphile/pg-pubsub --subscriptions --simple-subscriptions 等

我有:-
postgraphile --plugins pg-pubsub --subscriptions --simple-subscriptions 等

但是我知道它选择插件可以正常运行,因为它使用“-append-plugins MySubscriptionPlugin.js”而不是简单订阅启动服务器并列出“(启用订阅)”。

有没有人设法通过 CLI 运行简单的订阅

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)