- FEW2.9 Assignment #6: Mutations
- Build on top of Assignment #2: Collections
- GraphQL, Express, Nodemon
http://localhost:4000/graphql
- To access GraphQL Interface:
https://localhost:4000/graphql
- To Add a new pet to the list:
mutation {
addPet(name:"Name", species:"Species") {
name
}
}
query {
getPet(id: 1) {
name
species
}
}
query {
allPets {
name
species
}
}
- To Update a pet already on the list:
mutation {
updatePet(id:#) {
name
species
}
}
- To delete a pet already on the list (by ID):
mutation {
deletePet(id:#) {
}
}