graphene-federation
Federation implementation for graphene
What it is and what it does
graphene-federation bridges Graphene (a Python GraphQL library) with Apollo Federation, a specification for composing multiple GraphQL services into a single federated graph. It provides decorators and utilities to mark types as entities, define external fields, and implement reference resolution—the core mechanics needed for a Graphene service to participate in a federated architecture.
The package supports Apollo Federation specifications from v1.0 through v2.11, including directives like @key, @external, @requires, @provides, and @shareable. It integrates with graphene-directives for runtime validation of directive arguments. Most federation work involves decorating your types with @key or @extends, optionally defining __resolve_reference methods to fetch entities by their key fields, and building your schema with build_schema instead of the standard Graphene schema builder.
Use it for:
- Build a federated GraphQL gateway where multiple Python services each expose their own Graphene schema and the gateway composes them.
- Extend types defined in other federated services (e.g., add reviews to a Product type defined elsewhere) using @extends and @external.
- Implement entity resolution so a federated gateway can fetch specific instances of your types by their key fields during query planning.
- Migrate an existing Graphene application to a federated architecture without rewriting your entire schema.
- Share common types across multiple GraphQL services using @key and reference resolution.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds Apollo Federation support to Graphene GraphQL schemas, enabling multiple GraphQL services to compose into a federated graph following Apollo Federation specifications.
Yes, if you are building a federated GraphQL system with Graphene and need Apollo Federation support. The package is stable and permissively licensed, with low install friction. The aging maintenance status (309 days since last release) is a minor concern but not a blocker—the repository is active and there are no known vulnerabilities. Install it when federation is a hard requirement; avoid it if you don't need multi-service composition.
Install
graphene-federation on PyPI
pip
pip install graphene-federationuv
uv add graphene-federationpoetry
poetry add graphene-federationInstalling graphene-federation
Before you install
Low install friction with a pure Python wheel. Maintenance status is aging—last release was 309 days ago—but the repository remains active and not archived, with recent commits as of 2025-10-09.
License in practice
MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice.
Quickstart
pip install graphene-federation
from graphene import ObjectType, String, Int, Field
from graphene_federation import build_schema, key
@key("id")
class User(ObjectType):
id = Int(required=True)
name = String()
class Query(ObjectType):
user = Field(User)
schema = build_schema(query=Query)
Verify before relying
- Whether the package supports all Apollo Federation v2.11 directives equally well in practice or if some have known limitations.
- Performance characteristics when handling large federated graphs or complex entity resolution scenarios.
- Current adoption and community support level given the aging maintenance status.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — graphene, graphql-core, graphene-directives |
| Maintenance | aging — 309 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 74,814/month — #14,789 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: graphene_federation-3.3.0-py3-none-any.whl
Keywords: graphene, graphql, gql, federation
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
grapheneGraphene is a Python library for building…
permissive · top 1,000 on PyPI
ariadneAriadne is a Python library for building…
permissive · top 5,000 on PyPI
graphene-djangoGraphene-Django bridges Django models and…
permissive · top 5,000 on PyPI
graphene-file-uploadAdds file upload support to GraphQL mutations…
permissive · top 15,000 on PyPI
starlette-graphene3Mounts a GraphQL API built with Graphene v3…
permissive · top 15,000 on PyPI
graphene-sqlalchemyGraphene-SQLAlchemy exposes SQLAlchemy database…
permissive · top 15,000 on PyPI
gqlA GraphQL client for Python that executes…
permissive · top 1,000 on PyPI
graphene-pydanticConverts Pydantic models into GraphQL object…
permissive · top 15,000 on PyPI
graphql-core-promiseAdds promise-based resolver and dataloader…
permissive · top 15,000 on PyPI
pycadfPyCADF implements the Cloud Auditing Data…
permissive · top 15,000 on PyPI