Introduction to schema 📘
The schema is the blueprint of your GraphQL API.
GraphQL is a type-safe query language, and that's all thanks to the schema. The schema tells us the type of every field and how they relate to each other. As you type in GraphQL Playground, you'll see intellisense and validation based on this schema.
A basic schema
type User {
id: ID!
name: String!
posts: [Post!]!
}
type Comment {
id: ID!
content: String!
author: User!
}
type Post {
id: ID!
title: String!
author: User!
comments: [Comment!]!
}This schema defines three types: User, Post, and Comment. Each type has a set of fields, and each field has a type. The ! symbol means that the field is required.