From the course: Learning GraphQL (2021)
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Introducing the GraphQL schema definition language - GraphQL Tutorial
From the course: Learning GraphQL (2021)
Introducing the GraphQL schema definition language
- [Instructor] So far, we've talked about a couple different pieces of the GraphQL spec. We have talked about the query language, and then we've touched on the schema definition language, which is a language that defines all of our API's types. So, in order to send these queries, we need a well-defined schema. So, let's take a closer look at some of the pieces that make up the schema definition language. First of all, in GraphQL, we have a few different scalar types. In other words, if we're going to return a single value, we can return either an int, a float, a string, a Boolean, or an ID. So, these represent just one little container of data. If a field returns one thing, it's going to return one of these five built-in scalar types. When we set this up in our schema, it'll look like this. We'll define the name of the field, like ID. And then, we'll set that to a value that's being returned. In this case, an ID or, for the…