Skip to main content

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

MIT License

Project details


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 details)

Uploaded Source

Built Distribution

gqlactioncable-0.0.2-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file gqlactioncable-0.0.2.tar.gz.

File metadata

  • Download URL: gqlactioncable-0.0.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.13

File hashes

Hashes for gqlactioncable-0.0.2.tar.gz
Algorithm Hash digest
SHA256 14aae53b76ce42ae5dab0cef8da0d0ab22302e04724478ade180487accc66be1
MD5 c4e84ca485d4e6bf36435ba712475ed3
BLAKE2b-256 7f90f8643936758a1e24f076a26fed6b542c5913e413ab81640639d0947a70ac

See more details on using hashes here.

File details

Details for the file gqlactioncable-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for gqlactioncable-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 96b3ef9a5a8a431ffe727782d59f3b550a86e6ee6f684bfa3b791837bcf9cf52
MD5 add969d5d272e8bc1390d68699a40722
BLAKE2b-256 01ea4018fe32017a3ec40070da5c19c711a2171facc3337b8df41f1643af0d54

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page