1

我想将订阅添加到我拥有的 react 项目中,该项目当前使用通过运行 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 运行简单的订阅?

4

0 回答 0