This is based on the 1st project(ecomm-app-graphql) in the book - Practical GraphQL
This is a backend API project. It requires nodemon to be installed globally. npm i -g nodemon
- Install npm modules with
npm install . - Run the app with
npm run dev. - Open the browser on
http://localhost:4000.
There are 3 models/objects Courses, Genres and Reviews.
- The database is hardcoded, but the CRUD commands will work as expected in Apollo Studio.
- The main parts of the App are queries and resolvers. Most of the heavy lifting is done in the resolvers.
- Mutators are for Modifying and deleting items.
- It uses exclamations to prevent
nullvalues.
- The code is well organized and leads the user in creating the app progressively.
- The code for the api calls were displayed as pixelated images, making it hard to read it clearly.
- The rest of the code could have been better presented with syntax highlighting.
- Some of the code snippets were not shown exactly where they would go in the code and were left to the user to decide.
- Feel free to add fields if they belong to the entity.
query{
courses {
id
name
}
}
query{
genres {
id
name
}
}
query{
reviews {
id
title
courseId
}
}
mutation($addReviewInput2: AddReviewInput!){
addReview(input: $addReviewInput2) {
id
rating
date
}
}
{
"addReviewInput2": {
"date": "2025-09-05",
"title": "The best book",
"comment": "Must read for everyone",
"rating": 5,
"courseId": "book-06"
}