gql
GraphQL client for Python
Decision gist · record as of 2026-08-14
Yes. GQL is a mature, actively maintained GraphQL client with no known vulnerabilities, low install friction, and broad protocol support. It's well-suited for any Python project that needs to consume GraphQL APIs, whether synchronously or asynchronously. The permissive MIT license and stable API make it a reliable choice for production use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires an asyncio event loop; synchronous usage is available but not recommended in environments like Jupyter where an event loop already exists.
- Low install friction with a pure-Python wheel distribution.
- Actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal attribution requirements.
last release 2025-08-17 (362 days) · last repo commit 2026-07-24 · 1,679 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 25,202,541 downloads/mo, #905 on PyPI
Alternatives
Verify before relying
from gql import Client, gql
from gql.transport.aiohttp import AIOHTTPTransport
import asyncio
async def main():
transport = AIOHTTPTransport(url="https://api.example.com/graphql")
client = Client(transport=transport)
query = gql("query { user { id name } }")
async with client as session:
result = await session.execute(query)
print(result)
asyncio.run(main())- Whether the package supports Python 3.8.1 as stated in requires_python or only 3.9+ as suggested by classifiers
- Performance characteristics under high concurrency or large result sets
- Maturity level of the experimental AWS AppSync realtime protocol support
What it is and what it does
GQL is a GraphQL client library that lets you send queries, mutations, and subscriptions to any GraphQL server from Python. It supports both synchronous and asynchronous execution, with async allowing concurrent requests. The client can work with multiple transport protocols—HTTP via aiohttp, WebSockets with apollo or graphql-ws protocols, Phoenix channels, and experimental AWS AppSync support—making it flexible for different backend setups.
The library includes local query validation against a schema (fetched from the server or provided locally), file upload support, custom scalar and enum handling, request batching, and a DSL module for composing queries dynamically. It also ships with a command-line tool for executing queries and downloading schemas. The architecture is inspired by React-Relay and Apollo-Client, so developers familiar with those patterns will recognize the design.
Use it for
- Build a Python application that queries a GraphQL API (e.g., GitHub, Shopify, or a custom backend) using sync or async code.
- Implement real-time subscriptions to a GraphQL server using WebSocket transports for live data feeds.
- Validate GraphQL queries locally before sending them to the server to catch errors early in development.
- Batch multiple GraphQL requests into a single network call to reduce latency and server load.
- Upload files as part of GraphQL mutations in applications that need to handle media or document uploads.
- Use the gql-cli command-line tool to introspect and download GraphQL schemas from servers for documentation or code generation.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
GQL is a mature, actively maintained GraphQL client with no known vulnerabilities, low install friction, and broad protocol support. It's well-suited for any Python project that needs to consume GraphQL APIs, whether synchronously or asynchronously. The permissive MIT license and stable API make it a reliable choice for production use.
Install
gql on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release and no known vulnerabilities. Depends on four stable runtime libraries (graphql-core, yarl, backoff, anyio).
Requires an asyncio event loop; synchronous usage is available but not recommended in environments like Jupyter where an event loop already exists.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal attribution requirements.
Quickstart
from gql import Client, gql
from gql.transport.aiohttp import AIOHTTPTransport
import asyncio
async def main():
transport = AIOHTTPTransport(url="https://api.example.com/graphql")
client = Client(transport=transport)
query = gql("query { user { id name } }")
async with client as session:
result = await session.execute(query)
print(result)
asyncio.run(main())
Verify before relying
- Whether the package supports Python 3.8.1 as stated in requires_python or only 3.9+ as suggested by classifiers
- Performance characteristics under high concurrency or large result sets
- Maturity level of the experimental AWS AppSync realtime protocol support
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8.1 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesgraphql-coreyarlbackoffanyio |
| Maintenance | Actively maintained 362 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 25,202,541 / month, #905 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries |
Evidence: gql-4.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “graphql client python”
- gqlA GraphQL client for Python that executes queries, mutations, and…
- python-graphql-clientSends GraphQL queries, mutations, and subscriptions to a GraphQL…
- ariadne-codegenGenerates fully typed, asynchronous Python GraphQL clients from a…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also convex · python-graphql-client · ariadne · sgqlc · graphql-server · graphqlclient · graphene · Flask-GraphQL · ariadne-codegen · graphql-relay