Skip to content

GraphQL Stack Example: Apollo Server & TypeGraphQL & TypeORM

License

Notifications You must be signed in to change notification settings

linbudu599/GraphQL-Explorer-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL-Explorer-Server

GitHub Workflow Status Codecov GitHub last commit David

GitHub package.json dependency version (subfolder of monorepo) GitHub package.json dependency version (subfolder of monorepo) GitHub package.json dependency version (subfolder of monorepo)

This is a demo which contains GraphQL and framework based on it(or work with it perfectly), including these for now:

🚀  Explore

npm install
npm run dev

🛵  Available Scripts

  • dev: develop server by nodemon.
  • build: compile server code by tsc.
    • prebuild: Generation of GenQL & Prisma Client.
    • postbuild: copy generated Prisma Client files, run prisma db push to create SQLite file.
  • build:vercel: build scripts on Vercel Functions.
  • start: run in prod by nodemon(recommended to run before deployment).
  • clean: remove /dist(build output) & api-dist(Vercel build output) directory.
  • test: run test cases by Jest.
  • pm2: run in prod by PM2.
  • stress-test: run pressure test to server, see stress-fork.js & stress-main.js.
  • voyager: represent GraphQL API as an interactive graph by GraphQL-Voyager, require local server to be active.
  • gen:code: generate type definitions from GraphQL schema by GraphQL-Code-Generator.
  • gen:docs: generate documentation site from GraphQL schema by GraphDoc.
  • gen: generate docs & code, as gen:code & gen:docs require local server alive, this command will use NodeJS child_process mod to handle server setup.
  • serve:docs: generate & serve documentation site by serve.
  • commit: commit code by custom commitlint config.
  • prettier: prettier all .ts / .json / .graphql ext file.
  • typecheck: check TypeScript type definitions.
  • seed:config: check typeorm-seeding config.
  • seed:run: start seeding data in /server/entity/seeds.
  • genql: generate GraphQL query builder by GenQL.
  • prisma:* Prisma 2 Related Commands.

Main

  • GraphQL
  • TypeGraphQL
  • Apollo-Server
  • DataLoader (Supported By TypeGraphQL-DataLoader)
  • TypeORM + SQLite3
  • Prisma 2(As replacement for TypeORM)
  • Subscription

Other Powerful Tools

Features

  • TypeORM Entity Relations Setup: 1-1 1-m m-n
  • Most API of TypeGraphQL: InputType / InterfaceType / AuthChecker / Middlewares / Containers / ...
  • Configurated Apollo-Server With Plugins
  • Visualized API Graph by GraphQLDoc & GraphQL-Voyager
  • Useful Directives & Decorators

🏗️   Server & Docs Deployment

📔  Document

see offcial docs for more information.