First, you need to create a backend directory in your GraphQL project (graphql/backend), after that let's review the huge list of NPM packages you will need to install (the most relevant):
npm init --yes
npm install @contentpi/lib @graphql-tools/load-files @graphql-tools/merge apollo-server dotenv express jsonwebtoken pg pg-hstore sequelize ts-node
npm install --save-dev husky jest prettier sequelize-mock ts-jest ts-node-dev typescript eslint @types/jsonwebtoken
The scripts you should have in your package.json file should be as follows:
"scripts": {
"dev": "ts-node-dev src/index.ts",
"start": "ts-node dist/index.js",
"build": "tsc -p .",
"lint": "eslint . --ext .js,.tsx,.ts",
"lint:fix": "eslint . --fix --ext .js,.tsx,.ts",
"test": "jest src"
}
In the next section, we are going to configure our environment...