graphql-python / graphql-python/graphql-core-legacy
Subscription must return Async Iterable or Observable. Received:
- Ngôn ngữ chính
- Python
- Star
- 371
- Fork
- 175
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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)
```
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu với graphql/execution/executor.py ở khoảng dòng 296 và xem xét cách tiếp cận của graphql-core đối với subscriptions được liên kết. Ghi lại những giá trị trả về nào được hỗ trợ, bao gồm async iterables và Observables, đồng thời giải thích nên hiểu async-generator resolver được minh họa như thế nào. Công việc được coi là hoàn tất khi một người mới có thể xác định cách triển khai một subscription mà không cần dựa vào chuỗi thảo luận.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- api
- Loại issue
- Tài liệu
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100