So far, we've looked at a few different schema types:
- Documents
- Objects
But did you know that you've seen more than just those two? You've actually seen two more:
- String
- Number
Believe it or not, these "field types" are also schema types! And there are way more than just String and Number - we can even customize String and Number to our own needs.
Over the next few pages, we'll be working on making a new Document type called Blog Post, where we'll be using various different schema types to create blog content which we'll later use GROQ and Next.js to display.
You can delete your Dog and Cat documents by just deleting their files and removing them from the schemaTypes array. However, we will touch back on them when we get to the References module - up to you!
You could also remove them from the schemaTypes array - your data will be preserved, but hidden from the Studio.
Create our Blog Post document
This part should be pretty straightforward. We'll create a new file called blogPost.js
, and add our document schema boilerplate, along with adding it to the schemaTypes array:
export default { name: 'blogPost', type: 'document', title: 'Blog Post', fields: [],}
import blogPost from './blogPost'
export const schemaTypes = [blogPost]
Studio will complain about not having any fields, but we'll fix that soon.