Skip to content

mrblueblue/graphql-express-sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-express-sqlite

Getting Started

npm start

Examples

Query all of Bob's messages:

curl -XPOST -H 'Content-Type:application/graphql' \
-d 'query RootQueryType { users(name: "Bob"){ messages{text} } }' \
http://localhost:3000/graphql

Query Tim's user id:

curl -XPOST -H 'Content-Type:application/graphql' \
-d 'query RootQueryType { users(name: "Tim"){id} }' \
http://localhost:3000/graphql

Create a new user named Kerry:

curl -XPOST -H 'Content-Type:application/graphql' \
-d 'mutation M { createUser(name: "Kerry") { name } }' \
http://localhost:3000/graphql

Post a new message from Kerry

curl -XPOST -H 'Content-Type:application/graphql' \
-d 'mutation M { postMessage(name: "Kerry", text: "Hello I am Kerry") { text } }' \
http://localhost:3000/graphql

About

graphql with express, sqlite, and async-await

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published