Skip to content

th14g0d3v/crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation



Crud   |    Summary   |    Tecnologies   |    Project   |    Usage   |    Playground   |    Challenge   |    License   |    Credits




CRUD is fullstack application in typegraphql



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



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" }
  )
}


  • Query find user by email
  • Query find all users by emails
  • Create User
  • Update User
  • Delete User
  • Login User
  • Logout User


This project is under the MIT license. See the LICENSE file for more details.