Create the composite
reference: Ceramic Docs - Create your composite
A composite is your database schema for ComposeDB, which includes a collection of data models. Once created, your composite instructs your node which models to index and also allows your client to perform queries and mutations on these models.
To create composites in your application, you have two routes to choose from:
Loading an Existing Model Using a Model ID
Creating a Composite from a GraphQL File
Loading an Existing Model Using Model ID
To load an existing model into your working directory using its unique model ID, follow these steps:
Fetch the Model: Run the command below, replacing the
<model-id>
with your specific model ID. Here's a previously deployed Nova test model: kjzl6hvfrbw6c7c9c35xsdcnzle6fqmc97f9kniqanxudbrb10xg78hul55dhfbcomposedb composite:from-model kjzl6hvfrbw6c7c9c35xsdcnzle6fqmc97f9kniqanxudbrb10xg78hul55dhfb --ceramic-url=http://localhost:7007 --output=evp-report-template.json
This command will fetch the model from Ceramic and save it locally as evp-report-template
.json
.Verify the Output: You should see confirmation in your terminal similar to:
✔ Creating a composite from models... Composite was created and its encoded representation was saved in my-first-composite.json
You now have the model stored locally and ready for use in your project.
Last updated