Simple client for querying GraphQL from Python using
requests
.
pip install gqlite
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
.