https://github.com/sashkachan/clj-dgraph
Clojure wrapper for processing Clojure vectors into Dgraph strings
https://github.com/sashkachan/clj-dgraph
clj clojure-library dgraph graph
Last synced: 26 days ago
JSON representation
Clojure wrapper for processing Clojure vectors into Dgraph strings
- Host: GitHub
- URL: https://github.com/sashkachan/clj-dgraph
- Owner: sashkachan
- License: mit
- Created: 2017-05-31T06:45:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T07:52:10.000Z (almost 9 years ago)
- Last Synced: 2026-02-01T15:19:27.365Z (about 1 month ago)
- Topics: clj, clojure-library, dgraph, graph
- Language: Clojure
- Size: 5.86 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clj-dgraph
Clojure library to turn Clojure vectors and maps into Dgraph query strings
[](https://clojars.org/clj-dgraph)
## Usage
```
(require 'clj-dgraph.core)
(def query
[:query
[:director.name
[{:func :me, :args {:id 1}}
[{:func :allofterms :args [:name "quoted-name"]} :title2 :title3 ]]]])
(clj-dgraph.core/vec->query query)
```
Will return (non-pretty printed):
```
query{
director.name
me(id:1) {
allofterms(name, "quoted-name") {
title2
title3
}
}
}
```
# TODO
- [ ] Support schema definitions
- [ ] Add some syntactic sugar for queries
## License
Copyright © 2017 Aleksandr Guljajev
Distributed under the MIT License.