Demonstrates how to use ariadne subscriptions.
This example uses pipenv for dependency management:
pip3 install pipenv
pipenv --three
pipenv install
pipenv run uvicorn --reload --port=5000 --http=h11 --ws=websockets app:app
Visit http://localhost:5000 to load the GraphQL Playground.
Execute the following query to see that the ping
query type returns a String, as defined in app/__init__.py
:
query {
ping
}
Execute the following subscription to see the subscription return multiple responses over time:
subscription {
counter
}