graphql-python / graphql-server

This is the core package for using GraphQL in a custom server easily
MIT License
120 stars 72 forks source link

Asynchronous Support #2

Closed mgenti closed 4 years ago

mgenti commented 7 years ago

I was looking through the code in init.py to try and adapt the "return_promise" option to work with Tornado's IOLoop. I started with the example in the sanic-graphql repository.

Looking through how the graphql-server package uses the promise library it looks like the query is always executed immediately. I believe this is due to the fact that the executor never yields anything for an event loop to iterate on.

I have not used the promise library before so I might be missing something. Could you help me clarify how to use graphql-server asynchronously?

dpnova commented 7 years ago

I've got it working in sanic, which is an async framework, maybe check out the https://github.com/graphql-python/sanic-graphql implementation?