【问题标题】:Apollo-graphql: using withFilterApollo-graphql:使用 withFilter
【发布时间】:2018-08-24 08:25:05
【问题描述】:

您能否解释一下传递给withFilter 函数的变量 参数的来源。 here提供的例子没有说明。

在调用publish 时会提供payload,但variables...

我们从哪里得到它们?如果需要设置它们,那么我们该如何实现呢?

【问题讨论】:

    标签: node.js apollo graphql-subscriptions


    【解决方案1】:

    好的,我想通了。 variables 是传递给订阅的变量。

    例如,如果订阅如下所示:

    followUser(userId: String!): SomeType!
    

    那么userId将在variables

    【讨论】:

      猜你喜欢
      • 2020-09-13
      • 2020-11-14
      • 2017-09-01
      • 2018-03-20
      • 2020-09-13
      • 2017-11-30
      • 2019-09-14
      • 2020-03-29
      • 2020-09-13
      相关资源
      最近更新 更多