Skip to content

Play with ComposeDB & Ceramic network and fix models relationship dynamically

License

Notifications You must be signed in to change notification settings

marc-aurele-besner/composedb-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

composedb-playground

This is a simple playground for experimenting with Ceramic and and ComposeDB. It can be especially useful for building models with relations.

Getting Started

Install dependencies:

pnpm install

Start the Ceramic daemon:

pnpm dev

Build the composite (in a separate terminal)

pnpm build

Start the GraphQL server:

pnpm start:graphql

Write models with relations

Take as example the following models:

type Comment @loadModel(id: "[modelName:comment]") {
  id: ID!
}

type Post @loadModel(id: "[modelName:post]") {
  comments: [Comment] @relationFrom(model: "Comment", property: "postID")
}

When running

pnpm build

The relation will be fixed automatically by replacing [modelName:comment] with the actual model id of the Comment model, if there is relation that can't be resolved on the first pass, the build script will resolve each relations until all relations are resolved.

Documentation

ComposeDB

About

Play with ComposeDB & Ceramic network and fix models relationship dynamically

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published