graphql-python / graphql-python/graphql-core-legacy
Execute should return an awaitable with AsyncioExecutor
- Langage dominant
- Python
- Étoiles
- 372
- Forks
- 175
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
The current graphql.execution.execute.execute implementation forces AsyncioExecutor to use loop.run_until_complete in wait_until_finished. This is a bit ugly.
It would be better to let the executor decide what is returned from the execute method. It can be given a function to call after the data is ready as an argument.
With this AsyncioExecutor could return an awaitable and execute would be used as one would expect
`result = await execute(schema, ast, executor=AsyncioExecutor())`
It could even have an argument to get the new way to keep compatibility with existing uses.
This would also make TwistedExecutor much easier to implement.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez dans graphql.execution.execute.execute et examinez comment AsyncioExecutor utilise wait_until_finished, puis comparez les points d’intégration de l’exécuteur pertinents pour TwistedExecutor. Définissez comment l’exécuteur fournit le callback post-données et comment la compatibilité est préservée. Le travail est terminé lorsque AsyncioExecutor peut renvoyer un awaitable utilisable avec await execute, tout en continuant à prendre en charge les utilisations existantes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- api
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 25/100