PROJECT
CRUD is fullstack application in typegraphql
USAGE
Clone the repository to the desired folder.
git clone https://github.com/th14g0d3v/crud.git
Navigate to the repository folder.
cd crud
Starting the application backend.
Navigate to the server folder.
cd backend
Install the necessary packages for the project.
npm install or yarn
Install the PostgreSQL. PostgreSQL
Start the postgresql(on linux).
sudo systemctl start postgresql
Turn on the server, which is at 127.0.0.1:4000.
yarn start
PLAYGROUND
In Browser
http://localhost:4000/graphql
// Find user by email
query {
emailOfUser(email: {email: "jack.sparrow@gmail.com"}) {
id
firstName
lastName
nickName
email
password
}
}
// Find all users by emails
query {
listOfUser {
id
firstName
lastName
nickName
email
password
}
}
// Create User
mutation {
createUser(data: {
firstName: "Jack"
lastName: "Sparrow"
nickName: "Captian Sparrow"
email: "jack.sparrow@gmail.com"
password: "jack"
})
{
id
firstName
lastName
nickName
email
password
}
}
// Delete User
mutation {
deleteUser(email: "jack.sparrow@gmail.com")
}
// Update User
mutation {
updateOfUser(
email: "jack.sparrow@gmail.com"
data: { firstName: "Jack", lastName: "Sparrow", nickName: "Captain Jack" }
)
}
CHALLENGE
- Query find user by email
- Query find all users by emails
- Create User
- Update User
- Delete User
- Login User
- Logout User
CREDITS
Made by Thiago Gomes.