Skip to content

How to integrate flask and ariadne to allow subscriptions? #740

Answered by rafalp
Draqun asked this question in Q&A
Discussion options

You must be logged in to vote

Key take-away from subscriptions documentation is in big yellow box at its beginning:

Because of their nature, subscriptions are only possible to implement in asynchronous servers that implement the WebSockets protocol.

WSGI-based servers (including Django) are synchronous in nature and unable to handle WebSockets which makes them incapable of implementing subscriptions.

Flask is synchronous and WSGI based, which means it won't support subscriptions. graphql_sync() doesn't support them, and so does @web.route because subscriptions are made over the websocket protocol, which is different from regular HTTP.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Draqun
Comment options

Answer selected by Draqun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants