Skip to main content

A fast and modern graphql client designed with simplicity in mind.

Project description

Qlient: Python GraphQL Client

qlient-org pypi versions license

A fast and modern graphql client designed with simplicity in mind.

Help

See documentation for more details

Installation

pip install qlient

Quick Start

from qlient import Client

client = Client("https://api.spacex.land/graphql/")

res = client.query.launchesPast(
    # spacex graphql input fields
    find={"mission_name": "Starlink"},
    limit=5,
    sort="mission_name",

    # qlient specific
    _fields=["mission_name", "launch_success", "launch_year"]
)

which sends the following query

query launchesPast($find: LaunchFind, $limit: Int, $sort: String) {
  launchesPast(find: $find, limit: $limit, sort: $sort) {
    mission_name
    launch_success
    launch_year
  }
}

to the server and return this body:

{
  "data": {
    "launchesPast": [
      {
        "mission_name": "Paz / Starlink Demo",
        "launch_success": true,
        "launch_year": "2018"
      },
      {
        "mission_name": "Starlink 1",
        "launch_success": true,
        "launch_year": "2019"
      },
      {
        "mission_name": "Starlink 2",
        "launch_success": true,
        "launch_year": "2020"
      },
      {
        "mission_name": "Starlink 3",
        "launch_success": true,
        "launch_year": "2020"
      },
      {
        "mission_name": "Starlink 4",
        "launch_success": true,
        "launch_year": "2020"
      }
    ]
  }
}

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-0.0.1a0.tar.gz (17.6 kB view hashes)

Uploaded Source

Built Distribution

qlient-0.0.1a0-py3-none-any.whl (19.9 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