Bird
0
0

What will be the output of the query { users(age_gt: 30) { name age } } if the database has users: Alice(25), Bob(35), Carol(40)?

medium📝 query result Q5 of 15
GraphQL - Queries
What will be the output of the query { users(age_gt: 30) { name age } } if the database has users: Alice(25), Bob(35), Carol(40)?
AAlice and Bob
BBob and Carol
COnly Carol
DAll three users
Step-by-Step Solution
Solution:
  1. Step 1: Interpret argument meaning

    Argument age_gt: 30 means users with age greater than 30.
  2. Step 2: Filter users by age

    Bob (35) and Carol (40) satisfy age > 30; Alice (25) does not.
  3. Final Answer:

    Bob and Carol -> Option B
  4. Quick Check:

    age_gt filters users older than 30 = Bob, Carol [OK]
Quick Trick: Use argument names like age_gt to filter by conditions [OK]
Common Mistakes:
  • Including users not matching the condition
  • Misunderstanding 'gt' as 'less than'
  • Ignoring the argument filter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes