Ariadne 0.16 release brings refactor to Ariadne's ASGI app which makes it more modular and adds support for old and new GraphQL websocket protocols. It also updates
load_schema_from_path to support
graphqls file types. Finally it bumps library's support for Starlette to version 0.20 and updates other dependencies to latest versions.
We thank our community for contributing features to this release. You rock! ❤️
GraphQL's HTTP and WebSocket protocols support has been factored out to separate classes, making it easier to implement and customize HTTP and WebSocket handling.
Updating to 0.16
If you are using subscriptions in your GraphQL API, you have to update your code:
from ariadne.asgi import GraphQL from ariadne.asgi.handlers import GraphQLWSHandler app = GraphQL( schema, websocket_handler=GraphQLWSHandler(), )
If you used event handlers for websocket connections, those should now be set on WebSocket handler directly:
from ariadne.asgi import GraphQL from ariadne.asgi.handlers import GraphQLWSHandler app = GraphQL( schema, websocket_handler=GraphQLWSHandler( on_connect=..., on_disconnect=..., on_operation=..., on_complete=..., ), )
graphqls support for
load_schema_from_path will now load files with
graphqls extensions in addition to
ariadne.asgi.GraphQLto use strategy pattern for handling HTTP and WebSockets.
load_schema_from_pathto also support
- Added support for