1.0.0 • Published 6 years ago

@front.build/supergraph v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
6 years ago

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.

Principles

Examples

Documentation