0
0
GraphQLquery~10 mins

Why tooling improves developer experience in GraphQL - Test Your Understanding

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

Complete the code to define a simple GraphQL query that fetches a user's name.

GraphQL
query GetUserName { user(id: 1) { [1] } }
Drag options to blanks, or click blank then click option'
Aid
Bage
Cemail
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a field that does not represent the user's name, like age or email.
2fill in blank
medium

Complete the code to add a variable for user ID in the query.

GraphQL
query GetUserName($id: [1]) { user(id: $id) { name } }
Drag options to blanks, or click blank then click option'
AString
BInt
CBoolean
DFloat
Attempts:
3 left
💡 Hint
Common Mistakes
Using String or Boolean for the user ID variable type.
3fill in blank
hard

Fix the error in the query by completing the missing type declaration.

GraphQL
query GetUser($id: [1]!) { user(id: $id) { name } }
Drag options to blanks, or click blank then click option'
AInt
BFloat
CString
DBoolean
Attempts:
3 left
💡 Hint
Common Mistakes
Using nullable types or wrong types like String or Boolean.
4fill in blank
hard

Fill both blanks to create a mutation that updates a user's email.

GraphQL
mutation UpdateEmail($id: [1]!, $email: [2]!) { updateUser(id: $id, email: $email) { id email } }
Drag options to blanks, or click blank then click option'
AInt
BString
CBoolean
DFloat
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up types or forgetting the required !.
5fill in blank
hard

Fill all three blanks to write a query that fetches a list of users with their IDs, names, and emails.

GraphQL
query GetUsers { users { [1] [2] [3] } }
Drag options to blanks, or click blank then click option'
Aid
Bname
Cemail
Dage
Attempts:
3 left
💡 Hint
Common Mistakes
Including unrelated fields like age or missing required fields.