A BFF toolkit for Python. Compose complex nested APIs declaratively — zero N+1, zero boilerplate.
pip install pydantic-resolve
Replace manual loops with declarative data loading.
# Sprint has 10 tasks, each needs owner
for task in sprint.tasks:
task.owner = await get_user(task.owner_id)
# 10 queries!
class TaskView(BaseModel):
owner_id: int
owner: Optional[UserView] = None
def resolve_owner(self, loader=Loader(user_loader)):
return loader.load(self.owner_id)
# 1 query!
From loading related data to generating GraphQL APIs — all in one library.
Auto-batch queries via DataLoader pattern. 100 lookups become 1 query.
Compute derived fields after all nested data is resolved. Counts, aggregates, formatting.
ExposeAs, SendTo, Collector — pass context down or aggregate data up without traversal code.
Centralize relationship declarations. Reuse across models, GraphQL, and MCP services.
Auto-generate GraphQL schema and resolvers from your ER Diagram.
Expose GraphQL APIs to AI agents via Model Context Protocol.
Start simple, scale as needed. Each concept builds on the last.
ER Diagram doubles as entity and use-case layer, cleanly isolating your database.
ER Diagram defines entities and their relationships — it naturally serves as both the domain model and the use-case boundary.
Loaders abstract away the data source. Swap SQLAlchemy for Django or Tortoise ORM — your models stay untouched.
One ERD drives REST API responses, GraphQL queries, and MCP services — without duplication.
Works with your existing frameworks and ORMs.
Start with a single resolve method. Scale to ER Diagram when you're ready.