https://github.com/quan-nh/lacinia-ring
https://github.com/quan-nh/lacinia-ring
clojure graphql lacinia ring
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/quan-nh/lacinia-ring
- Owner: quan-nh
- License: epl-1.0
- Created: 2017-03-21T07:58:40.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-29T10:51:40.000Z (over 8 years ago)
- Last Synced: 2025-01-03T19:24:28.882Z (about 1 year ago)
- Topics: clojure, graphql, lacinia, ring
- Language: Clojure
- Size: 21.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# try-lacinia
Playing with [walmartlabs/lacinia](https://github.com/walmartlabs/lacinia) library, a GraphQL implementation in pure Clojure.
## Usage
Start web service at port 3000
```sh
lein run
```
GraphiQL services at http://localhost:3000/
### Query, Mutation
Send POST requests to `/graphql` url with query data
```sh
curl http://localhost:3000/graphql \
-X POST \
-H "Content-Type: application/graphql" \
-d '{hero {id name friends {name}}}'
==>
{
"data": {
"hero": {
"friends": [
{
"name": "Luke Skywalker"
},
{
"name": "Han Solo"
},
{
"name": "Leia Organa"
}
],
"id": "2001",
"name": "R2-D2"
}
}
}
curl http://localhost:3000/graphql \
-X POST \
-H "Content-Type: application/graphql" \
-d '{human(id: "1001") {name}}'
==>
{
"data": {
"human": {
"name": "Darth Vader"
}
}
}
```
### Subscription
Send query message to `ws://localhost:3000/graphql-ws`
```
subscription { ping (count: 4 message: "test") { message }}
```
## License
Copyright © 2017 FIXME
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.