Bird
0
0

Which of the following is the correct way to write a query in GraphQL Playground?

easy📝 Syntax Q3 of 15
GraphQL - Basics and Philosophy
Which of the following is the correct way to write a query in GraphQL Playground?
Aselect * from user where id = 123
Bquery { user(id: "123") { name email } }
C{ user(id: 123) => { name, email } }
DGET /user/123 { name, email }
Step-by-Step Solution
Solution:
  1. Step 1: Recognize GraphQL query syntax

    GraphQL queries start with 'query' keyword and use braces to specify fields.
  2. Step 2: Identify the correct syntax

    query { user(id: "123") { name email } } uses correct syntax with quoted string id and field selection.
  3. Final Answer:

    query { user(id: "123") { name email } } -> Option B
  4. Quick Check:

    Syntax = Correct GraphQL query format [OK]
Quick Trick: GraphQL queries use braces and field names, not SQL or REST syntax [OK]
Common Mistakes:
  • Using SQL or REST syntax instead of GraphQL
  • Missing quotes around string IDs
  • Using arrows or commas incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes