create-apollo-api
v1.0.0
Published
CLI tool to quickly set up an Apollo GraphQL server with TypeScript or JavaScript
Downloads
97
Maintainers
Readme
create-apollo-api
A CLI tool to quickly set up an Apollo GraphQL server with TypeScript or JavaScript support.
Installation
npm install -g create-apollo-apiOr use with npx (no installation needed):
npx create-apollo-apiUsage
create-apollo-api [project-name] [options]Options
-p, --package-manager <manager>- Package manager to use:npm,pnpm, orbun(default:npm)-l, --language <lang>- Language:jsorts(default:ts)--no-install- Skip installing dependencies
Examples
Create a TypeScript project with npm (default):
create-apollo-api my-graphql-serverCreate a JavaScript project with pnpm:
create-apollo-api my-server -l js -p pnpmCreate a project without installing dependencies:
create-apollo-api my-server --no-installCreate a TypeScript project with bun:
create-apollo-api my-server -p bunWhat it creates
The CLI tool automatically sets up:
- ✅ Project directory with
package.jsonconfigured for ES modules - ✅
src/directory withindex.tsorindex.jscontaining a working Apollo Server example - ✅ TypeScript configuration (
tsconfig.json) if using TypeScript - ✅ All necessary dependencies (
@apollo/server,graphql, and TypeScript packages if needed) - ✅ Scripts in
package.jsonto compile and run the server
Generated Project Structure
project-name/
├── package.json
├── src/
│ └── index.ts (or index.js)
└── tsconfig.json (TypeScript only)Running the Server
After creation, navigate to your project and start the server:
cd project-name
npm start # or pnpm start / bun startThe server will be available at http://localhost:4000/
License
MIT
