Skip to content

Repository files navigation

Lighthouse

Lighthouse

Build GraphQL APIs in Go. Fast.

ReleaseGo ReferenceGo Report CardLicense

DocumentationQuick Start中文


What is Lighthouse?

Lighthouse is a batteries-included GraphQL framework for Go. Define your schema, run one command, and get a production-ready API with DataLoaders, authentication, and database migrations.

typeUser@loader(keys: ["id"]) {
id: ID!name: String!@varchar(length: 100)
posts: [Post!]!@goField(forceResolver: true)
}
extendtypeQuery {
me: User!@auth
}
lighthouse generate:schema # That's it. Models, resolvers, dataloaders generated.

Features

FeatureDescription
Schema-FirstDefine GraphQL schema, generate Go code
DataLoaderAuto-generated, N+1 problem solved
Auth Directives@auth, @own built-in
DatabaseGORM + MySQL, connection pooling, master-slave
MigrationsAtlas-powered schema migrations
QueueRedis-based async jobs (asynq)
MessagingNATS pub/sub for real-time
StorageS3/MinIO/COS unified interface
MetricsPrometheus + health checks

5-Minute Start

# Install
go install github.com/light-speak/lighthouse@latest
# Create project
lighthouse generate:init --module github.com/you/myapp --models user,post
cd myapp
# Configure .env, then run
go run . app:start

Open http://localhost:8080 → GraphQL Playground ready.

Project Structure

myapp/
├── schema/ # GraphQL definitions
├── models/ # Generated Go structs
├── resolver/ # Your business logic
├── graph/ # gqlgen generated (don't touch)
├── commands/ # CLI commands
├── server/ # HTTP server setup
└── migrations/ # Database migrations

Tech Stack

Documentation

📚 Full Documentation

Contributing

PRs welcome. Open an issue first for major changes.

License

MIT


Built with ☕ by Light Speak

About

This may be the most useful GraphQL framework in Golang (but it's not finished yet and is being written).

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages