0
0
GraphQLquery~20 mins

GraphQL Playground and tools - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
GraphQL Playground Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary purpose of GraphQL Playground?

GraphQL Playground is a popular tool used by developers. What is its main purpose?

ATo convert SQL queries into GraphQL queries
BTo deploy GraphQL servers automatically
CTo write and test GraphQL queries interactively
DTo monitor server CPU and memory usage
Attempts:
2 left
💡 Hint

Think about what developers do when they want to try out queries before coding.

query_result
intermediate
2:00remaining
What is the output of this GraphQL query in Playground?

Given the schema with a user type having fields id and name, what is the output of this query?

{ user(id: 1) { id name } }
GraphQL
{ user(id: 1) { id name } }
A{ "data": { "user": { "id": "1", "name": null } } }
B{ "data": { "user": null } }
C{ "errors": [ { "message": "Field 'user' not found" } ] }
D{ "data": { "user": { "id": 1, "name": "Alice" } } }
Attempts:
2 left
💡 Hint

Assume the user with id 1 exists and has the name 'Alice'.

📝 Syntax
advanced
1:30remaining
Which option contains a syntax error in GraphQL Playground?

Identify the GraphQL query that will cause a syntax error when run in GraphQL Playground.

A{ user(id: 4) { id name }
B{ user(id: 3) { id name } }
C{ user(id: 2) { id name } }
D{ user(id: 5) { id name } }
Attempts:
2 left
💡 Hint

Look for missing or extra characters that break the query structure.

optimization
advanced
1:30remaining
Which tool helps optimize GraphQL queries by analyzing performance?

Among these tools, which one is designed to help developers optimize GraphQL queries by analyzing their performance and complexity?

AGraphiQL
BApollo Engine
CGraphQL Voyager
DGraphQL Playground
Attempts:
2 left
💡 Hint

This tool provides metrics and tracing for GraphQL APIs.

🔧 Debug
expert
2:00remaining
What error message will GraphQL Playground show for this query?

Given the schema does not define a posts field on the Query type, what error will GraphQL Playground return for this query?

{ posts { id title } }
GraphQL
{ posts { id title } }
A{ "errors": [ { "message": "Cannot query field 'posts' on type 'Query'." } ] }
B{ "data": { "posts": [] } }
C{ "errors": [ { "message": "Field 'posts' is deprecated." } ] }
D{ "data": null }
Attempts:
2 left
💡 Hint

Think about what happens when you query a field not defined in the schema.