Skip to main content

graphql-ws-aiohttp

Code CI Test Coverage Latest PyPI version Apache License

Port of graphql-ws-next for graphql-core v3.

A GraphQL WebSocket server and client to facilitate GraphQL queries, mutations and subscriptions over WebSocket (for Python 3.6+). This code is based on the current implementation of subscriptions-transport-ws.

PyPI

pip install graphql-ws-aiohttp

Source code

https://github.com/dls-controls/graphql-ws-aiohttp

Changelog

https://github.com/dls-controls/graphql-ws-aiohttp/blob/master/CHANGELOG.rst

Getting Started

Start by installing the package using pip:

Or, by using your favorite package manager, like Poetry:

With aiohttp

Usage with aiohttp is simple:

For other frameworks

Adding support for other web frameworks is simple. A framework must provide a concrete implementation of graphql_ws.abc.AbstractConnectionContext, and then it’s ready to use with the SubscriptionServer.

Usage

Using apollo-link-ws you can opt to use websockets for queries and mutations in addition to subscriptions.

Use it with GraphiQL

Look in the demo<./demo>_ directory to see usage examples for GraphiQL. Due to the implementation of the javascript client for GraphiQL (GraphiQL-Subscriptions-Fetcher), queries and mutations will not be handled over websocket.

Contributing

This project uses Poetry, so to contribute, simply fork and clone this repository, and then set up your virtual environment using:

If you don’t yet have Poetry installed, please follow the documentation for installation.

Code formatting is done via black, and code should be well-typed using mypy.

License

This package is licensed under the MIT License.

Metadata

Release files for graphql-ws-aiohttp 0.0.1

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

Source distribution (sdist)

Source distribution for graphql-ws-aiohttp 0.0.1
File Size Uploaded
graphql-ws-aiohttp-0.0.1.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphql-ws-aiohttp 0.0.1
File Interpreter ABI Platform
graphql_ws_aiohttp-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.5 kB

Release files / graphql-ws-aiohttp-0.0.1.tar.gz

Download URL graphql-ws-aiohttp-0.0.1.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
facae6100f63421c94ff893bf9cd5037942ec824d1931564ae1713b88d8bb143
BLAKE2b-256 checksum
How to use checksums
c17c808a9fbe06f9fcb9f04eb2e15c424748e45050f70c4cdfaca095c7a1bf66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release files / graphql_ws_aiohttp-0.0.1-py3-none-any.whl

Download URL graphql_ws_aiohttp-0.0.1-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b209b54ee539b36d9ef209de986b14de53b45bc674328c6847561e1b61e8b70
BLAKE2b-256 checksum
How to use checksums
d627ce0e0840146a3dfc2d87764d4f6b78d32ec871ac81949889013df1b1d600
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.1 This release

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