This application allows users to search for books, add them to their favorites and delete them. While the application uses the Google Books API, the main purpose of this project was to convert a RESTful
server to GraphQL
.
Simply just create an account by signing in then, the option to save a book and view your saved books will be available. Otherwise, without creating an account, the user can still search for books but without the other functionalities.
"dependencies": {
"apollo-server-express": "^2.25.2",
"bcrypt": "^4.0.1",
"express": "^4.17.1",
"graphql": "^15.5.1",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.9.10"
},
"devDependencies": {
"nodemon": "^2.0.3"
}
"dependencies": {
"@apollo/react-hooks": "^4.0.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"apollo-boost": "^0.4.9",
"bootstrap": "^4.4.1",
"graphql": "^15.5.1",
"graphql-tag": "^2.12.5",
"jwt-decode": "^2.2.0",
"react": "^16.13.1",
"react-bootstrap": "^1.0.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1"
},
Also, using concurrently
in the main directory to run both the server and the client.
Searched Books |
---|
Saved Books |
---|
Using
GraphQL
instead of the standardRESTful
application definitely has some pros and cons. The good side ofGraphQL
is that the performance is greatly increased by only getting the data the user asks for. However, there is a learning curve which could take some time to get used to it but, once it's understood, the rest actually becomes very easy. It takes away the stress of creating routes, and it also divides some work to theFront-End
as well.
Overall I think I'm going to useGraphQL
whenever the application size is larger, but for smaller applications I'll still be using the classicRESTful
methods.
Copyright © Kemal Demirgil. All rights reserved. Licensed under the MIT license.