Skip to main content

A blazingly fast and modern graphql client based on qlient-core and aiohttp

Project description

Qlient AIOHTTP: Python GraphQL Client

DeepSource DeepSource pypi versions license

A blazingly fast and modern graphql client based on qlient-core and aiohttp

Key Features

  • Compatible with Python 3.7 and above
  • Build on top of qlient-core and aiohttp
  • support for subscriptions

Help

See the documentation for more details.

Quick Preview

This preview is using the official github/graphql/swapi-graphql graphql api.

import asyncio

from qlient.aiohttp import AIOHTTPClient, GraphQLResponse


async def main():
    async with AIOHTTPClient("https://swapi-graphql.netlify.app/.netlify/functions/index") as client:
        result: GraphQLResponse = await client.query.film(
            ["title", "id"],  # fields selection
            id="ZmlsbXM6MQ=="  # query arguments
        )

        print(result.request.query)
        print(result.data)


asyncio.run(main())

Which results in the following query being sent to the server

query film($id: ID) {
    film(id: $id) {
        title
        id
    }
}

And returns the body below

{
  "film": {
    "title": "A New Hope",
    "id": "ZmlsbXM6MQ=="
  }
}

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

qlient-aiohttp-0.1.0b1.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

qlient_aiohttp-0.1.0b1-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

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