For a python library for building graphql apis, the strongest matches are strawberry-graphql/strawberry (Strawberry is a comprehensive, code-first GraphQL library for Python), mirumee/ariadne (Ariadne is a schema-first Python library that provides robust) and graphql-python/graphene (Graphene is a mature, code-first library for building GraphQL). graphql-python/graphql-core and graphql-python/graphene-django round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
We curate open-source GitHub repositories matching “best python graphql libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
Strawberry is a type-safe GraphQL library for Python that enables the design of schemas using Python type annotations and dataclasses. It functions as an asynchronous GraphQL server and execution engine, providing a bridge to expose schemas across ASGI-compliant web frameworks such as FastAPI, Django, Flask, and Litestar. The project implements GraphQL Federation, allowing for the creation of distributed schemas and entities that merge into a unified supergraph across multiple services. It also includes a dedicated toolkit for the Relay specification, supporting global object identification a
Strawberry is a comprehensive, code-first GraphQL library for Python that natively supports async execution and provides seamless integration with both Django and FastAPI, covering all the core requirements for building modern GraphQL APIs.
Ariadne is a schema-first Python library that provides robust support for GraphQL APIs, including built-in integrations for both Django and FastAPI, asynchronous execution, and real-time subscriptions.
Graphene is a library and framework for building type-safe GraphQL APIs and schemas using Python objects and resolvers. It provides a system for mapping internal data models to typed GraphQL schemas, enabling the creation of servers that process queries and execute resolvers to return structured data. The project includes a full implementation of the Relay specification, providing standardized patterns for global object identification and cursor-based pagination. It utilizes a class-based approach to schema definition and supports interface-based type inheritance. The framework covers a broa
Graphene is a mature, code-first library for building GraphQL APIs in Python that integrates well with Django, though it lacks native support for modern asynchronous execution patterns compared to newer alternatives.
A Python 3 port of the GraphQL.js reference implementation of GraphQL.
This is the foundational reference implementation for GraphQL in Python, providing the core engine that powers higher-level frameworks like Graphene and Ariadne.
Graphene-Django is a GraphQL integration framework and schema mapper used to build typed APIs for Django applications. It functions as a database API layer that transforms Django model fields and relationships into a graph schema, allowing clients to request specific data in a single call. The project implements the Relay specification, providing tools for global object identification and standardized connection-based pagination to manage large datasets. It distinguishes itself by mapping database models, forms, and serializers directly into GraphQL object types and mutations. The framework
This framework provides a robust, code-first approach to building GraphQL APIs specifically for Django, offering deep integration with models and support for subscriptions and Relay.
graphql-tools is a toolkit for constructing, modifying, and combining GraphQL schemas. It provides a suite of utilities for parsing Schema Definition Language, managing resolver bindings, and assembling executable schemas. The project enables the composition of unified GraphQL gateways by merging multiple independent subschemas through schema stitching. This includes capabilities for entity type merging, type extension, and field resolution delegation to route requests across different services. The toolkit also includes a mocking engine that generates simulated GraphQL schemas and data. Thi
This is a TypeScript-based toolkit for schema manipulation and composition in the Apollo ecosystem, which does not provide the Python-based GraphQL API development capabilities requested.
Pydantic is a data validation and serialization library that enforces schema constraints and performs type conversion on complex data structures. It utilizes standard Python type annotations to define data models, allowing developers to establish structured schemas that automatically enforce business rules and constraints without the need for custom domain-specific languages. The library distinguishes itself by transforming high-level model definitions into optimized code during initialization to minimize runtime overhead. It supports recursive validation for nested data structures and employ
Pydantic is a data validation and serialization library that serves as a foundational building block for many GraphQL frameworks, but it does not provide the GraphQL-specific routing, schema execution, or subscription management required to be a GraphQL library itself.
Pydantic is a data validation library and parsing framework for Python. It functions as a type-based schema validator that uses standard Python type annotations to ensure input data conforms to predefined structural schemas. The project provides capabilities for parsing raw data into typed objects through automatic type conversion and validation. This includes the serialization of data and the validation of data structures to enforce correctness. The framework covers several application areas, including the verification of API requests and the management of application configurations. It all
Pydantic is a data validation and parsing library that serves as a foundational building block for many GraphQL frameworks, but it does not provide the GraphQL-specific routing, schema definition, or query execution capabilities required to build an API.
Vue Apollo is a GraphQL integration library for Vue applications that connects Vue components to GraphQL APIs using Apollo Client. It provides a reactive data layer for querying, mutating, and subscribing to data from GraphQL endpoints, with automatic cache updates and real-time subscription support. The library offers multiple API surfaces for working with GraphQL data, including slot-based declarative components, composable functions for the Composition API, and Options API integration. It handles the full lifecycle of GraphQL operations, from automatic data fetching with reactive queries t
This is a client-side library for integrating GraphQL into Vue applications, whereas the visitor is looking for server-side Python frameworks to build and manage GraphQL APIs.
Django Ninja is a high-performance framework for building type-safe REST APIs using Django. It functions as an OpenAPI API framework and a type-safe wrapper that utilizes Python type hints to handle request validation and response serialization. The project distinguishes itself by integrating Pydantic-based data modeling to convert JSON inputs into strongly typed Python objects. It automatically generates OpenAPI schemas and interactive documentation pages directly from defined endpoint signatures. The framework supports asynchronous request processing to handle concurrent tasks. It employs
This is a framework for building REST APIs with Django, but it does not provide the GraphQL-specific functionality or schema management required for this category.
FastAPI is a high-performance Python web framework designed for building REST APIs. It operates as an ASGI web framework, providing a system to create structured HTTP endpoints that automatically serialize data and validate request parameters. The framework utilizes Python type hints to drive data validation and serialization, automatically generating machine-readable OpenAPI and JSON Schema specifications. This process enables the automatic creation of interactive, browser-based API documentation where endpoints can be tested directly. The project includes a dependency injection system for
FastAPI is a high-performance web framework for building REST APIs, but it is not a GraphQL library and would require additional third-party packages to implement GraphQL functionality.
Litestar is a high-performance Python ASGI web framework designed for building asynchronous APIs and web services. It functions as a type-safe toolkit that leverages Python type hints to provide automatic request validation and response serialization, while natively generating interactive API documentation based on the OpenAPI specification. The framework is distinguished by its integrated dependency injection system, which manages shared resources and resolves complex nested service chains directly within request handlers. It further organizes API development through class-based controllers
Litestar is a high-performance ASGI web framework for building RESTful APIs, but it does not provide the core GraphQL schema management or query execution capabilities required for this category.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| strawberry-graphql/strawberry | 4.7K | Python | MIT | |
| mirumee/ariadne | 2.3K | Python | bsd-3-clause | |
| graphql-python/graphene | 8.2K | Python | MIT | |
| graphql-python/graphql-core | 527 | Python | MIT | |
| graphql-python/graphene-django | 4.4K | Python | MIT | |
| apollographql/graphql-tools | 5.4K | TypeScript | MIT | |
| pydantic/pydantic | 26.9K | Python | mit | |
| samuelcolvin/pydantic | 28K | Python | MIT | |
| akryum/vue-apollo | 6K | TypeScript | MIT | |
| vitalik/django-ninja | 9.1K | Python | MIT |