GraphQL transport for gql for the ActionCable websockets protocol
Project description
gql-actioncable
This is a graphql-python/gql transport for the ActionCable websockets protocol.
Installation
You can install the transport with:
pip install gqlactioncable
Usage
Here is an example using the sorare.com GraphQL websockets backend:
import asyncio
from gql import Client, gql
from gqlactioncable import ActionCableWebsocketsTransport
async def main():
transport = ActionCableWebsocketsTransport(
url="wss://ws.sorare.com/cable",
)
async with Client(transport=transport) as session:
subscription = gql(
"""
subscription onAnyCardUpdated {
aCardWasUpdated {
slug
}
}
"""
)
async for result in session.subscribe(subscription):
print(result)
asyncio.run(main())
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gqlactioncable-0.0.2.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for gqlactioncable-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96b3ef9a5a8a431ffe727782d59f3b550a86e6ee6f684bfa3b791837bcf9cf52 |
|
MD5 | add969d5d272e8bc1390d68699a40722 |
|
BLAKE2b-256 | 01ea4018fe32017a3ec40070da5c19c711a2171facc3337b8df41f1643af0d54 |