This will be a clone for hacker news via the tutorial of GraphQL TS & Apollo
Typescript: Version under development ^@4.3.5 Ts-Node: Version under development @^1.1.8
General
$ npm init -y
$ npm install --save-dev typescript@latest ts-node@latest
$ touch tsconfig.json
$ npm install apollo-server@latest graphql@latest nexus@latest
@^3.1.1 | @^15.5.1 | @^1.1.0 | ^@3.5.0 | ^@3.5.0
$ npm install prisma --save-dev
$ npm install @prisma/client
$ npx prisma migrate dev --name "init"
$ npm install bycriptjs jsonwebtoken
https://www.howtographql.com/typescript-apollo/1-getting-started/ https://www.howtographql.com/typescript-apollo/2-a-simple-query/
- Apollo Server - A GraphQL server
- Nexus - For creating typesafe GraphQL Schema
- Prisma - ORM
- GraphQL - REST API alternative
$ npx ts-node --transpile-only src/schema /This will generate a schema and typegen
@package.json
'dev': 'ts-node --transpile-only --no-notify --exit-child src/index.ts'
'generate': 'ts-node --transpile-only src/schema.ts'
- process.cwd() - current working directory
- [query, mutation] = types
- @relation - for setting attribute of a model