Bird
0
0

Given this GraphQL query result for a field declared as Float:

medium📝 query result Q13 of 15
GraphQL - Schema Definition Language (SDL)
Given this GraphQL query result for a field declared as Float:
{ price: 19 }
What is the actual type of the returned value?
AFloat
BString
CInteger
DBoolean
Step-by-Step Solution
Solution:
  1. Step 1: Understand GraphQL Float type

    Float represents decimal numbers but can also return whole numbers as floats.
  2. Step 2: Analyze the value 19

    Even though 19 looks like an integer, GraphQL returns it as a Float type because the field is Float.
  3. Final Answer:

    Float -> Option A
  4. Quick Check:

    Float fields return numbers as floats, even whole numbers [OK]
Quick Trick: Float fields always return float type, even if whole number [OK]
Common Mistakes:
  • Assuming 19 is Integer
  • Thinking Float must have decimal point
  • Confusing with String

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes