Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrblueblue/graphql-express-sqlite
graphql with express, sqlite, and async-await
https://github.com/mrblueblue/graphql-express-sqlite
Last synced: 36 minutes ago
JSON representation
graphql with express, sqlite, and async-await
- Host: GitHub
- URL: https://github.com/mrblueblue/graphql-express-sqlite
- Owner: mrblueblue
- Created: 2015-09-19T07:26:49.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-25T16:48:56.000Z (about 9 years ago)
- Last Synced: 2024-10-31T18:38:15.416Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 148 KB
- Stars: 75
- Watchers: 4
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-graphql - graphql-express-sqlite - GraphQL server with Sqlite and Express (Examples / JavaScript Examples)
README
# graphql-express-sqlite
## Getting Started
```bash
npm start
```## Examples
Query all of Bob's messages:
```bash
curl -XPOST -H 'Content-Type:application/graphql' \
-d 'query RootQueryType { users(name: "Bob"){ messages{text} } }' \
http://localhost:3000/graphql
```Query Tim's user id:
```bash
curl -XPOST -H 'Content-Type:application/graphql' \
-d 'query RootQueryType { users(name: "Tim"){id} }' \
http://localhost:3000/graphql
```Create a new user named Kerry:
```bash
curl -XPOST -H 'Content-Type:application/graphql' \
-d 'mutation M { createUser(name: "Kerry") { name } }' \
http://localhost:3000/graphql
```Post a new message from Kerry
```bash
curl -XPOST -H 'Content-Type:application/graphql' \
-d 'mutation M { postMessage(name: "Kerry", text: "Hello I am Kerry") { text } }' \
http://localhost:3000/graphql
```