--- id: graphene-sqlalchemy version: "2.3.0" license: MIT license_treatment: permissive maintenance: aging --- # graphene-sqlalchemy — Graphene SQLAlchemy integration License: permissive · Maintenance: aging · Downloads: 581.9K/mo ## 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 above — verify before relying. Graphene-SQLAlchemy exposes SQLAlchemy database models as GraphQL object types, letting you build GraphQL schemas directly from your existing database layer. 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 pip install graphene-sqlalchemy uv add graphene-sqlalchemy poetry add graphene-sqlalchemy ## Installing graphene-sqlalchemy 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. 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) Requires graphene and SQLAlchemy to be installed; you must pass a SQLAlchemy session via context_value when executing queries. 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: unspecified - Install friction: low - Maintenance: aging - Downloads: 581.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags graphql sqlalchemy integration, graphql schema from database models, sqlalchemy to graphql, graphene sqlalchemy, graphql api from orm models, database schema graphql, sqlalchemy graphql types, graphql, orm-integration, schema-generation [View on SkillFed](https://skillfed.io/packages/graphene-sqlalchemy) · [View on PyPI](https://pypi.org/project/graphene-sqlalchemy/)