Develop with your data model anywhere.
Query and load
data
reactively.
Replicate between
peers without a central server.
$ npm install @aphro/runtime-ts
$ npm install --save-dev @aphro/codegen-cli
NOTE: Aphrodite is pre-release. See the roadmap.
// Define your schema User as Node { 1 id: ID<User> 2 name: string } & OutboundEdges { todos: Edge<Todo.ownerId> } Todo as Node { 1 id: ID<Todo> 2 text: string 3 completed: Timestamp | null 4 ownerId: ID<User> }
// Query your data function TodoList({viewer}) { const todos = useQuery( () => viewer.queryTodos().whereCompleted(P.equals(null)) ).data; return ( <li> {todos.map(todo => <Todo todo={todo} />)} </li> ); }