0
0
GraphQLquery~10 mins

Why GraphQL performance needs attention - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to fetch user data with GraphQL.

GraphQL
query { user(id: [1]) { name email } }
Drag options to blanks, or click blank then click option'
A"123"
B123
CuserId
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Using an unquoted number for the ID causes errors.
2fill in blank
medium

Complete the code to request posts with their titles and authors.

GraphQL
query { posts { title [1] { name } } }
Drag options to blanks, or click blank then click option'
Aauthor
Bwriter
CauthorName
Duser
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect field names causes no data to return.
3fill in blank
hard

Fix the error in the query to avoid requesting too much data.

GraphQL
query { users { id name [1] } }
Drag options to blanks, or click blank then click option'
AallPosts { title }
Bposts { title content comments { text } }
Cposts
Dposts { title }
Attempts:
3 left
💡 Hint
Common Mistakes
Requesting full post content and comments causes slow queries.
4fill in blank
hard

Fill both blanks to limit query results and improve performance.

GraphQL
query { posts(limit: [1]) { title author { name } [2] } }
Drag options to blanks, or click blank then click option'
A5
B10
Ccomments { text }
Dlikes
Attempts:
3 left
💡 Hint
Common Mistakes
Not limiting results or requesting too many nested fields slows queries.
5fill in blank
hard

Fill all three blanks to create an efficient query with filters.

GraphQL
query { posts(filter: { authorId: [1], published: [2] }) { title [3] } }
Drag options to blanks, or click blank then click option'
A"123"
Btrue
Ccomments { text }
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted IDs or requesting unnecessary fields causes slow queries.