graphene-sqlalchemy
Graphene SQLAlchemy integration
Decision gist · record as of 2026-08-14
Yes, if your project is already using SQLAlchemy and graphene and you need a straightforward way to expose models as GraphQL types. The low install friction and permissive license make it a practical choice. However, be cautious: the package has not been updated since June 2020, so verify that its dependencies (especially graphene and SQLAlchemy) remain compatible with your target versions before committing to it in a new project. No known security vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires graphene and SQLAlchemy to be installed; you must pass a SQLAlchemy session via context_value when executing queries.
- Low install friction with a pure-Python wheel.
- The package is aging (last release June 2020, no updates in over 5 years) but the repository remains active with recent commits; maintenance status suggests it is stable but not under active development.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use this package in commercial and proprietary projects with minimal restrictions.
last release 2020-06-04 (2262 days) · last repo commit 2025-09-04 · 986 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 581,893 downloads/mo, #5,905 on PyPI
Alternatives
Verify before relying
pip install "graphene-sqlalchemy>=2.0"
from graphene_sqlalchemy import SQLAlchemyObjectType
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
import graphene
Base = declarative_base()
class UserModel(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String)
class User(SQLAlchemyObjectType):
class Meta:
model = UserModel
class Query(graphene.ObjectType):
users = graphene.List(User)
def resolve_users(self, info):
return User.get_query(info).all()
schema = graphene.Schema(query=Query)- Whether the package remains compatible with current versions of graphene, SQLAlchemy, and modern Python releases beyond those listed in classifiers.
- Current state of the dependency chain (graphene, promise, six, singledispatch) and whether they are still maintained.
- Whether the aging status and lack of recent releases indicate unresolved bugs or compatibility issues with newer frameworks.
What it is and what it does
Graphene-SQLAlchemy bridges SQLAlchemy ORM models and GraphQL by providing a `SQLAlchemyObjectType` class that automatically converts your database schema into GraphQL types. You define a model class, wrap it with the integration, and immediately get a queryable GraphQL schema without writing resolver boilerplate.
The package handles the translation layer between SQL queries and GraphQL resolution, letting you use SQLAlchemy's query API within your resolvers. It depends on graphene (the core GraphQL library), SQLAlchemy, and several utility libraries (promise, six, singledispatch) to manage async patterns and Python 2/3 compatibility. The classifiers indicate Python 2.7 and 3.5–3.7 support, though the aging maintenance status means compatibility with newer Python versions is uncertain.
Use it for
- Rapidly prototype a GraphQL API from an existing SQLAlchemy-based application without rewriting model definitions.
- Expose database entities as GraphQL types in a Flask or Django project that already uses SQLAlchemy.
- Build a GraphQL layer on top of a legacy relational database schema managed by SQLAlchemy.
- Implement Relay-style pagination and filtering on GraphQL queries backed by SQLAlchemy ORM queries.
- Combine multiple SQLAlchemy models into a single unified GraphQL schema for a data aggregation service.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if your project is already using SQLAlchemy and graphene and you need a straightforward way to expose models as GraphQL types.
The low install friction and permissive license make it a practical choice. However, be cautious: the package has not been updated since June 2020, so verify that its dependencies (especially graphene and SQLAlchemy) remain compatible with your target versions before committing to it in a new project. No known security vulnerabilities.
Install
graphene-sqlalchemy on PyPI
Before you install
Low install friction with a pure-Python wheel. The package is aging (last release June 2020, no updates in over 5 years) but the repository remains active with recent commits; maintenance status suggests it is stable but not under active development.
Requires graphene and SQLAlchemy to be installed; you must pass a SQLAlchemy session via context_value when executing queries.
License in practice
MIT license is permissive; you can use this package in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install "graphene-sqlalchemy>=2.0"
from graphene_sqlalchemy import SQLAlchemyObjectType
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
import graphene
Base = declarative_base()
class UserModel(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String)
class User(SQLAlchemyObjectType):
class Meta:
model = UserModel
class Query(graphene.ObjectType):
users = graphene.List(User)
def resolve_users(self, info):
return User.get_query(info).all()
schema = graphene.Schema(query=Query)
Verify before relying
- Whether the package remains compatible with current versions of graphene, SQLAlchemy, and modern Python releases beyond those listed in classifiers.
- Current state of the dependency chain (graphene, promise, six, singledispatch) and whether they are still maintained.
- Whether the aging status and lack of recent releases indicate unresolved bugs or compatibility issues with newer frameworks.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesgraphenepromiseSQLAlchemysixsingledispatch |
| Maintenance | Aging 2,262 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 581,893 / month, #5,905 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries |
Evidence: graphene_sqlalchemy-2.3.0-py2.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 sqlalchemy integration”
- graphene-sqlalchemyGraphene-SQLAlchemy exposes SQLAlchemy database models as GraphQL…
- grapheneGraphene is a Python library for building GraphQL schemas and types…
- ariadneAriadne is a Python library for building GraphQL servers using 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 graphene · graphene-pydantic · graphene-django · graphene-django-optimizer · graphene-federation · marshmallow-sqlalchemy · sqlacodegen · graphene-file-upload · SQLAlchemy · GeoAlchemy2