aiohttp powered apollo like graphql client
Project description
turms
DEVELOPMENT
Inspiration
Rath is an Apollo (that typescript thing) like library for python, it supports a link like structure to facilitate json serialization of complex objects.
Features
-
includes modular links to support specificatiosn for
- Subscriptions (via websockets)
- File Uploads (multipart specifications)
-
Works well with turms created queries
Installation
pip install rath
Usage Query
from rath.links.auth import AuthTokenLink
from rath.links.aiohttp import AioHttpLink
from rath.gql import gql
auth = AuthTokenLink(token_loader=aload_token)
link = AioHttpLink(url="http://localhost:3000/graphql")
rath = Rath(links=[auth,link])
rath.connect()
query = qgl("query space ex")
result = rath.execute(query)
Generate beautifully typed Operations, Enums,...
Why Rath
Well "apollo" is already taken as a name, and rath (according to wikipedia) is an etruscan deity identified with Apollo.
Examples
This github repository also contains an example client with a turms generated query with the public SpaceX api, as well as a sample of the generated api.
Experimental
turms watch $PROJECT_NAME
Turms watch is able to automatically monitor your graphql folder for changes and autogenerate the api on save again. Requires additional dependency for watchdog
pip install turms[watch]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.