graphql-python / graphql-python/graphql-core-legacy
Execute should return an awaitable with AsyncioExecutor
- Dominant language
- Python
- Stars
- 372
- Forks
- 175
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.