Metadata-Version: 2.1
Name: gqlactioncable
Version: 0.0.2
Summary: GraphQL transport for gql for the ActionCable websockets protocol
Home-page: https://github.com/leszekhanusz/gql-actioncable
Author: Leszek Hanusz
Author-email: leszek.hanusz@gmail.com
License: MIT
Keywords: api graphql actioncable protocol gql client
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: PyPy
Description-Content-Type: text/markdown
Requires-Dist: gql[websockets] (<4.0,>=3.4.0)
Provides-Extra: dev
Requires-Dist: gql[websockets] (<4.0,>=3.4.0) ; extra == 'dev'
Requires-Dist: black (==22.3.0) ; extra == 'dev'
Requires-Dist: check-manifest (<1,>=0.42) ; extra == 'dev'
Requires-Dist: flake8 (==3.8.1) ; extra == 'dev'
Requires-Dist: isort (==4.3.21) ; extra == 'dev'
Requires-Dist: mypy (==0.910) ; extra == 'dev'

# 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",
    )

    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

[MIT License](https://github.com/graphql-python/gql/blob/master/LICENSE)


