@front.build/supergraph
v1.0.0
Published
<br/> <br/> <br/> <br/> <br/> <br/> <h3 align="center">▼ Supergraph</h3> <br/> <br/> <br/> <br/> <br/> <br/>
Downloads
4
Readme
Supergraph aims to solve the problem of managing data on the frontend.
Usage
var graph = new Supergraph()
graph.field('Comment/children[]', { type: 'Comment' })
graph.field('Comment/message', { type: 'String' })
graph.field('User/email', { type: 'String' })
graph.field('User/profile/backgroundColor', { type: 'String' })
graph.field('User/comments[]', { type: 'Comment' })
graph.on('diff', function(){
})
graph.set('User/1/email')
graph.get('User/1/email')
var query = graph.query()
query.given('User/email', 'matches', 'foo')
Why?
Because when you modify data on the frontend, you often change it from multiple different angles and it is hard to keep in sync.
This can be used to persist the client state to the database.