Skip to main content

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

Metadata

Release files for gqlactioncable 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gqlactioncable 1.0.2
File Size Uploaded
gqlactioncable-1.0.2.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gqlactioncable 1.0.2
File Interpreter ABI Platform
gqlactioncable-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.1 kB

Release files / gqlactioncable-1.0.2.tar.gz

Download URL gqlactioncable-1.0.2.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c2517ecb259c492183089bcbe13527cf2d9c53885486df27e309da102804ece7
BLAKE2b-256 checksum
How to use checksums
b4556753ab30f9c512596cc90d2aa18636b681f4b748fa4418f4432ea1b9eb57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / gqlactioncable-1.0.2-py3-none-any.whl

Download URL gqlactioncable-1.0.2-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0137aadbf4da8ccfd3ecf98f2b2f617419615363d19496049af6917a8be18f2a
BLAKE2b-256 checksum
How to use checksums
40f2a763fb849f6c39ad9f35130b0751f13a3a24aa2969e038d77f48bd29e5f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page