graphql-python / graphql-python/graphql-core-legacy

Subscription must return Async Iterable or Observable. Received:

オープン
#149 コメント 26 件 リアクション 11 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
372
フォーク
175
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello, I have previously gotten subscriptions to crudely work https://github.com/graphql-python/graphene/pull/500#issuecomment-325560994

But now i want to try the new version of the graphql-core library and here is how far I've gotten. It is not very clear to me what a Async Iterable is meant to be I assumed that its a Async generator?

but from this line it seems to be anything that is an instance of an Observable
https://github.com/graphql-python/graphql-core/blob/0b0551e7dfb724dedc66759145b9221595ec8598/graphql/execution/executor.py#L296
Is there any documentation for graphql-cores new approach to subscriptions .. I would very much like to learn more.

Here is what im trying
```
[GraphQLError('Subscription must return Async Iterable or Observable. Received: .compat at 0x7f6335e89d48>',)]

def resolve_sub_product(self, info, **input):
async def compat(result, delay):
yield result
await asyncio.sleep(delay)
return compat(make_sub(info, input.get('product')), .1)
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

graphql/execution/executor.py の 296 行目付近から始め、リンクされている graphql-core の subscriptions へのアプローチを確認してください。async iterables や Observables を含め、どの戻り値がサポートされているかを記録し、示されている async-generator resolver をどのように理解すべきか説明してください。ディスカッションスレッドに頼らずに、初心者が subscription の実装方法を判断できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。