Bird
0
0

You wrote this query in GraphQL Playground:

medium📝 Debug Q14 of 15
GraphQL - Basics and Philosophy
You wrote this query in GraphQL Playground:
query { user(id: 5) { name email } }

But you get an error. What is the likely cause?
AGraphQL Playground does not support arguments
BThe query keyword is missing
CField names must be uppercase
DThe id argument should be a string, so it needs quotes
Step-by-Step Solution
Solution:
  1. Step 1: Check argument types in GraphQL

    GraphQL requires string arguments to be in quotes. Here, id is likely a string but given without quotes.
  2. Step 2: Verify other options

    The query keyword is present, field names are case-sensitive but lowercase is valid, and Playground supports arguments. So only The id argument should be a string, so it needs quotes explains the error.
  3. Final Answer:

    The id argument should be a string, so it needs quotes -> Option D
  4. Quick Check:

    String args need quotes in GraphQL [OK]
Quick Trick: Put quotes around string arguments in queries [OK]
Common Mistakes:
  • Leaving string arguments unquoted
  • Assuming Playground lacks argument support
  • Changing field name case incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes