mrblueblue / graphql-express-sqlite

graphql with express, sqlite, and async-await

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:JavaScript 100.0%