Skip to content

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

License

Notifications You must be signed in to change notification settings

light-speak/lighthouse

Repository files navigation

Lighthouse

Lighthouse

Build GraphQL APIs in Go. Fast.

Release Go Reference Go Report Card License

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.

type User @loader(keys: ["id"]) {
  id: ID!
  name: String! @varchar(length: 100)
  posts: [Post!]! @goField(forceResolver: true)
}

extend type Query {
  me: User! @auth
}
lighthouse generate:schema  # That's it. Models, resolvers, dataloaders generated.

Features

Feature Description
Schema-First Define GraphQL schema, generate Go code
DataLoader Auto-generated, N+1 problem solved
Auth Directives @auth, @own built-in
Database GORM + MySQL, connection pooling, master-slave
Migrations Atlas-powered schema migrations
Queue Redis-based async jobs (asynq)
Messaging NATS pub/sub for real-time
Storage S3/MinIO/COS unified interface
Metrics Prometheus + 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

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •