skillfed

graphene-federation

Federation implementation for graphene

graphene-federation v3.3.0 74.8K downloads/30d#14,789 on PyPI41
Permissive license MIT AGING released

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-federation

uv

uv add graphene-federation

poetry

poetry add graphene-federation

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries

Tags

graphql federation grapheneapollo federation pythonfederated graphql schemagraphene subgraphmulti-service graphqlgraphql service compositionapollo subgraph support
graphqlfederationschema-composition

More Libraries packages