HOWTO
- Start mongo
- npm start
- http://localhost:9000/graphql
Mutation query
mutation {
addGadget(
name: "Test",
release_date: "01.01.1970",
by_company: "Test",
price: "1000"
) {
id,
price
}
}
{
"data": {
"addGadget": {
"id": "5d2f022e3d12b114b221248e"
}
}
}
mutation {
updateGadget(
id: "5d2f022e3d12b114b221248e", name: "Macbook Pro",
release_date: "January 10, 2006", by_company: "Apple",
price: "9999") {
id
name
release_date
by_company
price
}
}
mutation {
removeGadget(id: "5c51ae117eb446624aad1049") {
id
name
release_date
by_company
price
}
}
query
query {
queryGadgetById(id: "5d2f040570b81523476d307b") {
id,
price,
}
}
query {
queryAllGadgets {
id
}
}
query {
queryByPriceRange(priceMin: 0, priceMax: 1200) {
id,
price
}
}