【发布时间】:2017-11-27 15:47:29
【问题描述】:
我试图弄清楚如何使用 graphene-python 在我的架构中正确定义订阅。到目前为止,我已经实现了查询和突变,但是您如何定义 Subscription 类?
以下是我最初的想法:
class Subscription(graphene.Subscription):
name = graphene.String()
# rest of attributes...
def subscribe(self, args, context, info):
pass
有人可以提供一个小例子吗?任何帮助将不胜感激!谢谢你:)。
布赖恩
【问题讨论】:
-
我相信我已经弄明白了。一旦我对代码感到满意,我会在这里发布。
标签: python publish-subscribe graphql graphene-python graphql-subscriptions