Designing a GraphQL schema
A schema is a GraphQL file that is written using DSL syntax. Primarily, it contains root types (query, mutation, and subscription), and the respective types that are used in root types, such as object types, scalar types, interfaces, union types, input types, and fragments.
First, let’s discuss these types. You learned about root types (query, mutation, and subscription) and object types in the previous section. Let’s now learn more about scalar types.
Understanding scalar types
Scalar types resolve concrete data. There are three kinds of scalar types – built-in scalar types, custom scalar types, and enumeration types. Let’s discuss built-in scalar types first. GraphQL provides the following five kinds of built-in scalar types:
Int
: This stores integers, and is represented by a signed 32-bit integer.Float
: This stores a signed, double-precision, floating-point value.String
: This stores a sequence of UTF...