0
0
GraphQLquery~10 mins

Aliases for field renaming in GraphQL - Interactive Code Practice

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

Complete the code to rename the field name to userName using an alias.

GraphQL
{ user { [1]: name } }
Drag options to blanks, or click blank then click option'
AuserName
Bname
Cusername
Duser_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using the original field name instead of an alias.
Putting the alias after the field name.
Using invalid characters in the alias.
2fill in blank
medium

Complete the code to rename the field email to userEmail using an alias.

GraphQL
{ user { [1]: email } }
Drag options to blanks, or click blank then click option'
Aemail
BemailAddress
Cuser_email
DuserEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Using the original field name without alias.
Using an alias that does not match the instruction.
3fill in blank
hard

Fix the error in the alias syntax to rename age to userAge.

GraphQL
{ user { [1] age } }
Drag options to blanks, or click blank then click option'
AuserAge::
BuserAge
CuserAge:
D:userAge
Attempts:
3 left
💡 Hint
Common Mistakes
Missing colon after alias.
Using double colons.
Placing colon before alias.
4fill in blank
hard

Fill both blanks to rename firstName to first and lastName to last.

GraphQL
{ user { [1]: firstName, [2]: lastName } }
Drag options to blanks, or click blank then click option'
Afirst
BlastName
Clast
DfirstName
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping alias and field names.
Using original field names as aliases.
5fill in blank
hard

Fill all three blanks to rename id to userId, username to userName, and email to userEmail.

GraphQL
{ user { [1]: id, [2]: username, [3]: email } }
Drag options to blanks, or click blank then click option'
AuserId
BuserName
CuserEmail
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Using original field names instead of aliases.
Mixing up alias names.