Scalars are the primitive data types in GraphQL.
They represent leaf values that cannot be further queried.
GraphQL provides the following default scalar types:
Int → 32-bit integerFloat → floating-point numberString → textBoolean → true/falseID → unique identifier (usually serialized as string)type User {
id: ID!
name: String!
age: Int
isActive: Boolean!
}
id, name, age, isActive are scalar fieldsquery {
user {
id
name
isActive
}
}
Response: