# gql-actioncable
This is a [graphql-python/gql](https://github.com/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:
```python
import asyncio
from gql import Client, gql
from gqlactioncable import ActionCableWebsocketsTransport
async def main():
transport = ActionCableWebsocketsTransport(
url="wss://ws.sorare.com/cable",
keep_alive_timeout=60,
)
async with Client(transport=transport) as session:
subscription = gql(
"""
subscription onAnyCardUpdated {
anyCardWasUpdated {
card {
name
grade
}
}
}
"""
)
async for result in session.subscribe(subscription):
print(result["anyCardWasUpdated"])
asyncio.run(main())
```
## License
[MIT License](https://github.com/graphql-python/gql/blob/master/LICENSE)
Raw data
{
"_id": null,
"home_page": null,
"name": "gqlactioncable",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "api, graphql, actioncable, protocol, gql, client",
"author": null,
"author_email": "Leszek Hanusz <leszek.hanusz@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/b4/55/6753ab30f9c512596cc90d2aa18636b681f4b748fa4418f4432ea1b9eb57/gqlactioncable-1.0.2.tar.gz",
"platform": null,
"description": "# gql-actioncable\n\nThis is a [graphql-python/gql](https://github.com/graphql-python/gql) transport\nfor the ActionCable websockets protocol.\n\n## Installation\n\nYou can install the transport with:\n\n pip install gqlactioncable\n\n## Usage\n\nHere is an example using the sorare.com GraphQL websockets backend:\n\n```python\nimport asyncio\n\nfrom gql import Client, gql\n\nfrom gqlactioncable import ActionCableWebsocketsTransport\n\n\nasync def main():\n\n transport = ActionCableWebsocketsTransport(\n url=\"wss://ws.sorare.com/cable\",\n keep_alive_timeout=60,\n )\n\n async with Client(transport=transport) as session:\n\n subscription = gql(\n \"\"\"\n subscription onAnyCardUpdated {\n anyCardWasUpdated {\n card {\n name\n grade\n }\n }\n }\n \"\"\"\n )\n\n async for result in session.subscribe(subscription):\n print(result[\"anyCardWasUpdated\"])\n\n\nasyncio.run(main())\n```\n\n## License\n\n[MIT License](https://github.com/graphql-python/gql/blob/master/LICENSE)\n",
"bugtrack_url": null,
"license": null,
"summary": "GraphQL transport for gql for the ActionCable websockets protocol",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/leszekhanusz/gql-actioncable",
"Repository": "https://github.com/leszekhanusz/gql-actioncable"
},
"split_keywords": [
"api",
" graphql",
" actioncable",
" protocol",
" gql",
" client"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "40f2a763fb849f6c39ad9f35130b0751f13a3a24aa2969e038d77f48bd29e5f5",
"md5": "83d02cb09e7e1502bf04009edd2438f5",
"sha256": "0137aadbf4da8ccfd3ecf98f2b2f617419615363d19496049af6917a8be18f2a"
},
"downloads": -1,
"filename": "gqlactioncable-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "83d02cb09e7e1502bf04009edd2438f5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6459,
"upload_time": "2025-08-22T21:29:42",
"upload_time_iso_8601": "2025-08-22T21:29:42.564248Z",
"url": "https://files.pythonhosted.org/packages/40/f2/a763fb849f6c39ad9f35130b0751f13a3a24aa2969e038d77f48bd29e5f5/gqlactioncable-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b4556753ab30f9c512596cc90d2aa18636b681f4b748fa4418f4432ea1b9eb57",
"md5": "e64076a584261cc42fc8a62284501b07",
"sha256": "c2517ecb259c492183089bcbe13527cf2d9c53885486df27e309da102804ece7"
},
"downloads": -1,
"filename": "gqlactioncable-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "e64076a584261cc42fc8a62284501b07",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 6684,
"upload_time": "2025-08-22T21:29:44",
"upload_time_iso_8601": "2025-08-22T21:29:44.649668Z",
"url": "https://files.pythonhosted.org/packages/b4/55/6753ab30f9c512596cc90d2aa18636b681f4b748fa4418f4432ea1b9eb57/gqlactioncable-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-22 21:29:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "leszekhanusz",
"github_project": "gql-actioncable",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "gqlactioncable"
}