This is a simple playground for experimenting with Ceramic and and ComposeDB. It can be especially useful for building models with relations.
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
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.