Definition

Types define the structure of data in a GraphQL schema.

They specify what fields exist and what type of data each field returns.


Object Types

Object types represent real-world entities and contain fields.

type User {
  id: ID!
  name: String!
  age: Int
}

Scalar Types

Scalars represent primitive values.

Built-in scalars:

Example: