Tento lets you define a schema in TypeScript with metaobject and metafield models.
When you define your schema, it serves as the source of truth for future modifications in queries
and migrations.
Organize your schema files
You can declare your schema directly in TypeScript for now only in a single schema.ts file wherever you prefer!
Note: You can name your schema file whatever you like. For example, it could be definitions.ts, or something else.
Example:
In the Tento you can also specify tento.config.ts file for CLI migrations. In the config file you need to specify the path to your schema file. With this configuration, Tento will
read from the schema.ts file and use this information during the migration process. For more information
about the tento.config.ts file and migrations, please check: link
Metaobject schema declaration
A Metaobject should be defined with at least name, type, fieldDefinitions() fields.
Metafield schema declaration
A Metafield should be defined with at least name, key, type, fieldDefinition() fields.
Example
Once you know the basics, letβs define a schema example for a real project to get a better view and understanding