Your database.
Instant GraphQL API.
PyGraphile reads your database schema and generates a working GraphQL API — tables become types, columns become fields, and resolvers are wired up for you.
Features
Everything you need, nothing you don't
Drop in PyGraphile and get a GraphQL API with zero schema writing.
Schema introspection
Automatically reads your database tables, columns, and types. No manual mapping required.
Instant GraphQL
Generates a complete, executable GraphQL schema with types and query resolvers on the fly.
SQLite support
Full support for SQLite databases today, with PostgreSQL and MySQL support on the roadmap.
ASGI native
Returns a standard ASGI app you can mount into FastAPI, Starlette, or any ASGI framework.
Pure Python
Built with modern Python practices. Supports Python 3.9 through 3.13+.
Minimal setup
Three lines of code to go from a database file to a running GraphQL endpoint.
How it works
From database to API in seconds
PyGraphile handles the entire pipeline automatically.
-
Point to your database
Pass the path to your SQLite file. PyGraphile connects and reads the schema using PRAGMA introspection.
-
Schema is generated
Each table becomes a GraphQL type. Column names and SQL types are mapped to GraphQL fields and scalars automatically.
-
Resolvers are attached
Query resolvers are dynamically created for every table — no manual resolver writing needed.
-
Mount and serve
Get back an ASGI-compatible GraphQL app powered by Ariadne. Mount it in FastAPI or any ASGI server and you're live.
Quick start
Up and running in 3 lines
Install PyGraphile and plug it into your FastAPI app.
from pygraphile import PyGraphile from fastapi import FastAPI import uvicorn app = FastAPI() # Point to your SQLite database pg = PyGraphile('mydb.sqlite') # Mount the GraphQL app app.mount('/graphql', pg.get_query_app()) if __name__ == '__main__': uvicorn.run(app, port=8000)
# Given a "users" table with # id INTEGER, name TEXT, email TEXT type Users { id: Int name: String email: String } type Query { users: [Users] }
curl -X POST http://localhost:8000/graphql/ \ -H "Content-Type: application/json" \ -d '{"query":"{ users { id name email } }"}'
Roadmap
What's coming next
PyGraphile is actively developed. Here's where we're headed.
- Project setup & structure
- SQLite schema introspection
- GraphQL schema generation
- Query resolver implementation
- Mutation support
- PostgreSQL support
- MySQL support
- Filtering & pagination
- Authentication & authorization
- Plugin system
Start building today
Install PyGraphile and have your GraphQL API running in under a minute.