0
0
GraphQLquery~5 mins

Scalar types (String, Int, Float, Boolean, ID) in GraphQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a String scalar type in GraphQL?
A String scalar type represents textual data. It is used to store sequences of characters like names, descriptions, or any text.
Click to reveal answer
beginner
What kind of values does the Int scalar type hold in GraphQL?
The Int scalar type holds whole numbers without decimals, like 1, 42, or -7. It is used for counting or indexing.
Click to reveal answer
beginner
Explain the Float scalar type in GraphQL.
The Float scalar type stores numbers with decimals, such as 3.14 or -0.001. It is used for precise measurements or calculations.
Click to reveal answer
beginner
What does the Boolean scalar type represent in GraphQL?
The Boolean scalar type represents true or false values. It is used for yes/no or on/off conditions.
Click to reveal answer
beginner
What is the purpose of the ID scalar type in GraphQL?
The ID scalar type is a unique identifier, often used to identify objects. It is serialized as a string but treated specially to represent unique keys.
Click to reveal answer
Which scalar type would you use to store a user's age?
ABoolean
BString
CFloat
DInt
Which scalar type is best for storing a product price like 19.99?
AInt
BBoolean
CFloat
DID
What scalar type would you use to represent a true/false value?
AID
BBoolean
CString
DFloat
Which scalar type is typically used for unique object identifiers?
AID
BInt
CString
DBoolean
If you want to store a person's full name, which scalar type should you choose?
AString
BInt
CFloat
DBoolean
Describe the five main scalar types in GraphQL and give a simple example for each.
Think about common data types you use in everyday life.
You got /5 concepts.
    Explain why the ID scalar type is different from a String even though it is serialized as a string.
    Consider how IDs help find specific items in a list.
    You got /4 concepts.