Skip to content

mohxmd/graphql-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌬️ Breeze

A minimal Bun + GraphQL Yoga + Drizzle ORM starter with Zod, Biome, and a sprinkle of fun.


✨ Features

  • ⚑️ Bun runtime for speed
  • πŸ“œ GraphQL Yoga – simple, modern GraphQL server
  • πŸ—„οΈ Drizzle ORM + SQLite for typed database access
  • βœ… Zod for runtime schema validation
  • 🧹 Biome for linting & formatting (auto on save!)
  • 🎭 Custom error handling with GraphQLException
  • πŸ—οΈ Modular folder structure – src/graphql/modules/* keeps resolvers/types organized

πŸ“‚ Project Structure

src/
β”œβ”€β”€ db/            # Database (drizzle + migrations)
β”œβ”€β”€ env.ts         # Zod-powered environment validation
β”œβ”€β”€ graphql/       # GraphQL schema, resolvers, context
β”‚   β”œβ”€β”€ modules/   # Modularized features (task, user, etc.)
β”‚   └── schema.ts  # Yoga schema entrypoint
β”œβ”€β”€ lib/           # Utilities & custom exceptions
└── index.ts       # Server entrypoint

πŸš€ Getting Started

# Install dependencies
bun install

# Start dev server
bun run dev

# Run migrations
bun run db:migrate

INFO Server is running on: πŸ‘‰ http://localhost:3000/graphql


πŸ› οΈ Scripts

  • bun run dev – Start server in dev mode
  • bun run format – Format code with Biome
  • bun run lint – Lint & fix with Biome
  • bun run db:migrate – Run database migrations
  • bun run db:generate – Generate Drizzle migration files
  • bun run db:push – Push schema directly
  • bun run db:start-studio – Open Drizzle Studio

πŸ” Environment Variables

PORT=3000
NODE_ENV=development
DB_FILE_NAME=./breeze.sqlite
DEBUG=1

Validated with Zod in src/env.ts. Invalid configs will 🚫 exit early.


❗ Error Handling

Instead of raw GraphQLError, Breeze ships with a custom GraphQLException:

throw new GraphQLException("NOT_FOUND", {
  message: "Task not found",
});

This ensures consistent error responses with extensions.code. Available codes: BAD_USER_INPUT, UNAUTHENTICATED, FORBIDDEN, NOT_FOUND, CONFLICT, INTERNAL_ERROR, GRAPHQL_PARSE_FAILED, GRAPHQL_VALIDATION_FAILED.


πŸ§‘β€πŸ’» Contributing

PRs and issues are welcome! πŸŽ‰ Fork it, hack it, and send improvements.

πŸš€ Roadmap

  • Subscription example
  • Default error handling
  • GraphQLException v2

About

πŸƒ Minimal, fast, and modern GraphQL starter kit β€” Bun + Drizzle ORM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published