CRUD is fullstack application in typegraphql
git clone https://github.com/th14g0d3v/crud.git
cd crud
cd backend
npm install or yarn
PostgreSQLsudo systemctl start postgresql
yarn start
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" }
)
}
- Query find user by email
- Query find all users by emails
- Create User
- Update User
- Delete User
- Login User
- Logout User
Made by Thiago Gomes.