- NodeJs installed
- Terminal (any will do, preferably bash-based)
- A text editor (any will do)
Let’s get started
Create a project directory for the app.
mkdir simple_node_graphql_app && cd simple_node_graphql_app
install the local npm dependencies we require
npm install --save axios express express-graphql graphql nodemon
install global npm dependencies (read all about json-server)
npm install -g json-server
Generating test json data with Mockaroo
db.json file with the data generated or download from mockaroo from step one.
Now let’s start our servers and see how far our applications are doing.
npm run dev
npm run js-server
Now we test the graphql query in our browser
Click here to clone and run the above app yourself.
I would love to hear your feedback and thoughts, also feel free to relate any issues you have.
How to thank me?
- give this article a clap
- follow me on twitter
- tweet, share this lesson with 3 friends
- star the project on github
Hope you’ll find this useful! Thanks