Transcript from the "Schemas" Lesson
>> Scott Moss: All right, so let's hop right into the Schemas and then we'll start writing some code. So the first thing we wanna do is when we create a GraphQL server, is we need to create a schema. So I talked about it a little bit but a schema you have to create what's called a type definitions and you go from there.
[00:00:14] And the way we do that is we use something called a Schema Definition Language, or SDL for short. It'a basically, I think when people think of GraphQL, they think of this. When they say I'm using GraphQL, I'm writing GraphQL, what they're are actually thinking about the language. So the actual syntax that you use to write GraphQL, this is what it is.
[00:01:12] To create a schema versus concatenating strings together, which is really hard. I've done both, and concatenating strings together is way worse than just using functions, so that's that. So now what we're gonna do is, we're gonna use the Schema Definition Language to create some Schemas. So I just wanna talk about some of the base parts, and then we'll hop right into it.
[00:01:33] So some of the basic parts of a Schema, we have Types, and Types are constructs defining a shape with fields. So again, these are very much the same thing as types as you would have in like a type-safe language. Fields are literally keys on those Types that describe what type of value they can have.
[00:01:52] Scalars are a primitive type of value built into GraphQL, and there's different types of scalars and we're gonna go over those. And than you have Queries and Mutations and those are specific types that GraphQL expects you to create. Queries allow you to get data, Mutation allow you to create data.
[00:02:08] And those are basically the basic parts of creating a schema.