Skip to content

GalassoLuca/GraphQL-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Small comparison with GraphQL with single end poing and API REST

You can start the server with

npm start

GraphQL

end-point

GraphiQL end point at http://localhost:4000/graphql

Query from CommandLine

curl \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{ "query": "{ books { id } }" }' \
  http://localhost:4000/graphql

API REST

HTTP GET on http://localhost:4000/api/ to get all the books

HTTP GET on http://localhost:4000/api/:id to get a book from id

HTTP POST on http://localhost:4000/api/:id to update the book's author

TIPS

I have reproduced, and took inspiration, from the following articles.

Creating A GraphQL Server With Node.js And Express

Building a Node.js REST API with Express

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published