- replace Apollo Server with Apollo Server Express, install following libraries
npm install apollo-server-express apollo-server-core express @graphql-tools/schema
- install both ts-node package and the official typescript package globally by running:
npm install -g ts-node typescript
- or create an npm project and install the dependencies by running
npm install --save-dev ts-node typescript
run npm init and install typescript package as a dev dep
npm install typescript --save-dev
TypeScript's Native Compiler(tsc), npm script for running tsc is as follows:
{
//...
"script": {
"tsc": "tsc"
},
//...
}
initialize tsconfig.json settings by running:
npm run tsc -- --init
doublecheck that everything really works by running the compiler and the eslint from the command line with commands:
npm run tsc
npm run lint
- Create database table automatically for model Note
Note.sync()
display
\d
display table users
\d users
toggle expands display view
\x