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

Subscription must return Async Iterable or Observable. Received:

Ouverte
#149 26 commentaires 11 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
372
Forks
175
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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)
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par graphql/execution/executor.py autour de la ligne 296 et examinez l’approche de graphql-core concernant les subscriptions indiquée dans le lien. Documentez les valeurs de retour prises en charge, notamment les async iterables et les Observables, et expliquez comment il faut comprendre l’async-generator resolver présenté. Le travail est terminé lorsqu’une personne débutante peut déterminer comment implémenter une subscription sans dépendre du fil de discussion.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
api
Type d'issue
Documentation
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.