Skip to main content
Version: 0.4.x

Data Modeling

Learn how to model data for ComposeDB.

Introduction

Models and composites are the core building blocks for ComposeDB applications.

Models

A model is the GraphQL schema for a single piece of data (e.g. social post) including its relations to other models and accounts. Models are designed to be plug-and-play so they can easily be reused by developers; when multiple apps use the same model, they share the same underlying data set. To be usable in your ComposeDB app, you need to bundle one or more models into a composite.

# Example Model that stores a display name

type DisplayName @createModel(accountRelation: SINGLE, description: "Display name for a user") {
displayName: String! @string(minLength: 3, maxLength: 50)
}

Composites

A composite is a group of one or more models that defines the complete graph data schema for your app. Composites are used on both the ComposeDB server and the client.

Get Started

Model catalog

Discover reusable, plug-and-play models in the Model Catalog.

Writing models

Jump into the Writing Models guides to begin writing your own models.

Composites

Convert your models into a Composites for use by your application.