Let's get started with the backend server:
- First, inside the apollo project (the one we created with create-react-app), we need to create a new directory called backend, initialize a package.json file, and create inside the src folder:
cd apollo mkdir backend cd backend npm init -y mkdir src
- Now we need to install these dependencies:
npm install cors express express-graphql graphql graphql-tools mongoose nodemon babel-preset-es2015 npm install -g babel-cli
- In our package.json file, we need to modify our start script to use nodemon:
"scripts": { "start": "nodemon src/app.js --watch src --exec babel-node --presets es2015" }
File: package.json
- Then we need to create our app.js file, in which ...