Bird
0
0

Given the GraphQL query:

medium📝 query result Q13 of 15
GraphQL - Queries
Given the GraphQL query:
query { book { title author { name } } }

What data will this query return?
AOnly the book's title
BOnly the author's name
CThe book's title and the author's name
DThe book's title and author as a string
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the query structure

    The query asks for 'book' field with subfields 'title' and 'author'. The 'author' field itself has a subfield 'name'.
  2. Step 2: Understand nested data retrieval

    This means the query returns the book's title and inside author, only the name field.
  3. Final Answer:

    The book's title and the author's name -> Option C
  4. Quick Check:

    Nested fields return nested data = The book's title and the author's name [OK]
Quick Trick: Nested braces mean nested data fields [OK]
Common Mistakes:
  • Thinking only top-level fields are returned
  • Assuming author returns full object, not just name
  • Confusing syntax with JSON output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes