Ow yeahh it iz DONE. ( did you get it ? no ? π )
A lot of you want to create a simple MongoDB CRUD with GraphQL.
But hey, you want to try this new thing called deno
too.
Yup, try this example and go further explore things.
Build and Improve your App using the latest techs indeed! π
Well this is just a simple CRUD, It'll cover the most basic template you would want to build a simple server, expect nothing more. π
Just pull some requests / issues if you found one!
Thank you very much!
-
Install
deno
, this should be mandatory. -
Clone this thing.
-
cd debunktcar
and edit stuffs. -
Refer to this snippet on how to run the server.
( created for you, because we are all lazy to type those. )padul@universe:~$ chmod +x run
-
Then run the server with
./run
padul@universe:~$ ./run
-
Should be on
http://localhost:4000
-
Get all cars
query getCars { getCars { id manufacturer name power } }
-
Get car by its ID
query getCarById($id: ID!){ getCarById(id: $id){ id manufacturer name power } }
{ "id": "5ee74a120079915d000f5562" }
-
Create a New Car
mutation createCar($input: NewCar!){ createCar(input: $input){ id manufacturer name power } }
{ "input": { "manufacturer": "Datsun", "name": "GO Panca", "power": 1200 } }
-
Update a Car by its ID
mutation updateCar($input: EditCar!){ updateCar(input: $input){ id manufacturer name power } }
{ "input": { "id": "5ee74a120079915d000f5562", "manufacturer": "Datsun", "name": "GO Panca +", "power": 1650 } }
-
Delete a Car by its ID
mutation deleteCar($id: ID!){ deleteCar(id: $id){ id result } }
{ "id": "5ee74a120079915d000f5562" }
MIT
Thanks for reading until the bottom of this README, press the star button if you like it ! βοΈ