Bird
0
0

Which of the following is the correct syntax to request only the title and author fields of a book in GraphQL?

easy📝 Syntax Q3 of 15
GraphQL - Queries
Which of the following is the correct syntax to request only the title and author fields of a book in GraphQL?
A{ book { title author } }
B{ book title, author }
C{ book: title, author }
D{ book (title, author) }
Step-by-Step Solution
Solution:
  1. Step 1: Recall GraphQL field selection syntax

    Fields are requested inside curly braces nested under the parent field without commas.
  2. Step 2: Check each option's syntax

    { book { title author } } correctly nests title and author inside book with proper braces and spacing.
  3. Final Answer:

    { book { title author } } -> Option A
  4. Quick Check:

    Correct GraphQL field syntax = { book { title author } } [OK]
Quick Trick: Use nested braces without commas for fields [OK]
Common Mistakes:
  • Using commas between fields
  • Using colons incorrectly
  • Placing fields outside braces

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes