/gqlite

Lightweight client for GraphQL in Python

Primary LanguagePythonMIT LicenseMIT

gqlite

Simple client for querying GraphQL from Python using requests.

Installation

pip install gqlite

Usage

First set the two environment variables GQLITE_URL and GQLITE_TOKEN. You can also use a .env file for these. Then:

import gqlite

text = """
  hero {
    name
  }
}
"""
gqlite.query(text)  # returns a dict

You can also set variables using the variables keyword argument of gqlite.query.