https://github.com/bustle/rad
WIP for prototype node graph library
https://github.com/bustle/rad
Last synced: 11 months ago
JSON representation
WIP for prototype node graph library
- Host: GitHub
- URL: https://github.com/bustle/rad
- Owner: bustle
- Created: 2016-11-21T17:04:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-14T22:32:45.000Z (about 9 years ago)
- Last Synced: 2025-02-24T14:24:01.509Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RadGraph
*WIP* project to prototype working with a graph database at scale. The goal is to provide developers with the best possible interface for working against data in a graph. This means clearly defined NodeTypes, EdgeTypes, and packagable schemas.
#### Example Schema
```
import graph from 'rad'
const graph = new Graph('Bustle')
graph.schema(define => {
define.node('User', node => {
node.hasOne('Post')
})
define.node('Post', node => {
node.hasOne('User')
})
})
const UserNode = graph.nodeTypes['User']
const PostNode = graph.nodeTypes['User']
const {User, Post} = graph.nodes
const Post = PostType.Model
const tyler = await User.create({ name: 'Tyler' })
const post = await Post.create({ title: 'My Post' })
tyler.post = post
```
# Testing and Debugging
* `npm t`
* `npm t -- --watch`
* `npm t -- debug` _to use `node-inspector` so you can set `debugger` breakpoints that halt in a repl. Use the key `c` to continue since `node-inspecor` always breaks on the first executed line. Type `repl` to start a `repl` session and have access to the currently executing scope of the breakpoint._