Definition

Scalars are the primitive data types in GraphQL.

They represent leaf values that cannot be further queried.


Built-in Scalars

GraphQL provides the following default scalar types:


Example

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

Usage in Queries

query {
  user {
    id
    name
    isActive
  }
}

Response: