Accountant turned developer May 2, 2021! This is my absolute passion in life
and I can't wait to earn the opportunity to turn it into a career! ❤️🔥
Email: [email protected]
Phone: 203-645-8595
LinkedIn
Accountant turned developer May 2, 2021! This is my absolute passion in life
and I can't wait to earn the opportunity to turn it into a career! ❤️🔥
Email: [email protected]
Phone: 203-645-8595
LinkedIn
Remove the useEffect() Hook that sets the state for UserData.
Instead, use the useQuery() Hook to execute the GET_ME query on load and save it to a variable named userData.
Use the useMutation() Hook to execute the REMOVE_BOOK mutation in the handleDeleteBook() function instead of the deleteBook() function that's imported from API file. (Make sure you keep the removeBookId() function in place!)
index.js: Export your typeDefs and resolvers.
resolvers.js: Define the query and mutation functionality to work with the Mongoose models.
typeDefs.js: Define the necessary Query and Mutation types:
Query type:
me: Which returns a User type.
Mutation type:
login: Accepts an email and password as parameters; returns an Auth type.
addUser: Accepts a username, email, and password as parameters; returns an Auth type.
saveBook: Accepts a book author's array, description, title, bookId, image, and link as parameters; returns a User type. (Look into creating what's known as an input type to handle all of these parameters!)
removeBook: Accepts a book's bookId as a parameter; returns a User type.
User type:
_id
username
bookCount
savedBooks (This will be an array of the Book type.)
Book type:
bookId (Not the _id, but the book's id value returned from Google's Book API.)
authors (An array of strings, as there may be more than one author.)
description
title
image
link
Auth type:
token
user (References the User type.)
Replace the addUser() functionality imported from the API file with the ADD_USER mutation functionality.
This will hold the query GET_ME, which will execute the me query set up using Apollo Server.
on the server.js file
Use the Apollo useMutation() Hook to execute the SAVE_BOOK mutation in the handleSaveBook() function instead of the saveBook() function imported from the API file.
Make sure you keep the logic for saving the book's ID to state in the try...catch block!
LOGIN_USER will execute the loginUser mutation set up using Apollo Server.
ADD_USER will execute the addUser mutation.
SAVE_BOOK will execute the saveBook mutation.
REMOVE_BOOK will execute the removeBook mutation.
on the auth.js file
Replace the loginUser() functionality imported from the API file with the LOGIN_USER mutation functionality.
app.js file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.