Jdoyle5254/customer-graphql

Traversy Media's first graphql app

★ 0Forks 0GitHub ↗Compare

README

Customer Base

Resource: TraversyMedia series

  • in terminal 1: run the server file npm run dev
  • in terminal 2: run the json-server mock API npm run json
  • visit http://localhost:4000/graphql
    • Add query on the left side
    • Click the play button

GET /customer

{
  customer(id: "1"){
    name, 
    email, 
    age
  }
}

GET /customers

{
  customers{
    name, 
    email, 
    age
  }
}

POST /addCustomer

mutation{
	addCustomer(name: "Willie Nelson", age: 89, email: "[email protected]"){
    id, name, age, email
  }
}

DELETE /deleteCustomer

mutation{
	deleteCustomer(id: "1"){
    id
  }
}

UPDATE /editCustomer

mutation{
	editCustomer(id: "3", age: 44, email: "[email protected]"){
    id, name, age, email
  }
}

Contributors

loriculberson

Issues