Models

What are models?

Schema Screenshot

Schema models describe the shape of your content. They consist of several fields while each field can store various types of data (e.g: text, numbers or images). A field can also be a reference to another model, which allows you to build a complex content graph. The fields you associate with a model will also define how its content editing user interface will look.

Models will make up 90% or more of your project. When you create a structure such as Author, Book, Publisher and Book Club, these are nearly exclusively Models. Any time the content contains multiple values, you can be sure you want a model.

This is a contrast to Enumerations which are a finite list of options that are themselves just one value. This could represent In Print, Out of Print options on your Book model, for example.

A model is an object of one or more fields.

GraphCMS Fields:

  • Single Line Text
  • Multi Line Text
  • Markdown
  • Integer
  • Float
  • Checkbox
  • Date
  • DateTime
  • JSON
  • Enumeration (Reference/Select)

Creating a Model

Creating a model is very easy! Click on the blue button "Create Model" and you'll be presented with a screen like this.

"Model window in the CMI."

Display Name

This helps you identify the Model in your interface.

API ID

This is generated for you automatically, but you can rename it if you want. Generally, you will just leave this as we suggest.

Description

A small description for you to remember the intended use of this model.

Editing the Model

You can edit models by pressing the "Edit Model" button in the Schema View right next to its name. There you can change the name, API Id and the Description.

Deleting the Model

You can delete the Model by hovering over the title of the model, a red trashcan will appear. Type in the name of the Model when prompted to delete.

"Deleting a model"