Skip to content
graphql with express, sqlite, and async-await
Branch: master
Clone or download
Latest commit 43e5171 Sep 25, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
database
schema
.gitignore feat/ create sqlite db Sep 22, 2015
README.md
index.js style/ minor formatting Sep 23, 2015
package.json
server.js style/ minor formatting Sep 23, 2015

README.md

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
You can’t perform that action at this time.