Skip to content

lauriharpf/type-graphql-starter

Repository files navigation

Build code style: prettier

TypeGraphQL starter template

Starter template for bootstrapping a TypeGraphQL + Apollo Server GraphQL API. The purpose is to help getting started quickly with TypeGraphQL development by providing a runnable API with examples you can build on. Not endorsed by or affiliated with the TypeGraphQL team. Be sure to also check out the TypeGraphQL documentation and examples.

Getting started

  1. Install Node.js 14 or later.
  2. git clone https://github.com/lauriharpf/type-graphql-starter.git to clone this repository
  3. npm install in project root directory
  4. npm start to start the server
  5. Access Playground with browser, at http://localhost:4000/ by default. Check DOCS for the API definition and try running some queries, e.g.
query Posts {
  posts {
    id
    userId
    title
    body
  }
}
  1. CTRL-C stops the server

Other commands

  • npm test to run tests
  • npm test -- --coverage to run tests and collect code coverage
  • npm run lint to lint the project

Template contents

Customizing for your project

After installing and experimenting with the template (see Getting started), customize it to suit your needs:

  1. Set the name, version, description, license and author of your project in package.json
  2. Run npm install to update package-lock.json with the new package.json contents
  3. Customize or remove the project-specific files
    • .github/ISSUE_TEMPLATE/*
    • README.md
    • CODE_OF_CONDUCT.md
    • CONTRIBUTING.md
    • LICENSE
  4. Run git remote remove origin in the project root directory to remove link to the template repository
  5. Create a new repository, e.g. in Github
  6. Run git remote add origin YOUR_REPOSITORY_ADDESS to link with your new repository
  7. git push -u origin master to push the code

Remove the examples under src/posts and src/users when they are no longer useful for you.

Versioning

According to the TypeGraphQL version in the template.

About

Starter template for building a TypeGraphQL + Apollo Server GraphQL API

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published