- GIT installed
- NPM installed
-
Navigate to and/or create the directory where you want to install the app.
-
In terminal/shell, enter:
git clone git@github.com:MackRoe/GettingStarted-GraphQL.git
-
Then, still in terminal, do:
npm install
to install the needed node modules. -
To run the app, enter:
npm start
and navigate tolocalhost:4000/graphql
in your browser.
Queries are added on the left and the data returned appears on the right. To send a query, click the run [>] button.
- functional
{ allPets { name } }
{ getPet(index: 0) { name } }
{ getTime { hour second minute } }
{ getRandom(range: 100) }
{ petCount { total } }
{ petsInRange(start: 0, count: 2) { name } }
{ getPetBySpecies(species: "Cat") { name } }
{ allSpecies { name } }
- Create:
mutation { addPet(name, species) { name } }
-
Read: Use
getPet
query -
Update
mutation { updatePet(id, name, species) { name } }
- Delete
mutation { deletePet(id: 1) { name } }