0
0
GraphQLquery~10 mins

Search across types 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 search for all items with the keyword "GraphQL".

GraphQL
query { search(text: "GraphQL") { __typename [1] } }
Drag options to blanks, or click blank then click option'
Aname
Bdescription
Cid
Dtitle
Attempts:
3 left
πŸ’‘ Hint
Common Mistakes
Using title which may not exist on all types.
Using id which is less descriptive for search results.
2fill in blank
medium

Complete the code to include the description field in the search results.

GraphQL
query { search(text: "GraphQL") { __typename name [1] } }
Drag options to blanks, or click blank then click option'
Asummary
Bdescription
Ccontent
Ddetails
Attempts:
3 left
πŸ’‘ Hint
Common Mistakes
Choosing summary which may not be defined in the schema.
Choosing content which might be too long or detailed.
3fill in blank
hard

Fix the error in the fragment usage to fetch the author name.

GraphQL
query { search(text: "GraphQL") { __typename ... on Article { title author { [1] } } } }
Drag options to blanks, or click blank then click option'
Afullname
BauthorName
Cname
Dusername
Attempts:
3 left
πŸ’‘ Hint
Common Mistakes
Using fullname which is not defined.
Using authorName which is not a valid field.
4fill in blank
hard

Fill both blanks to fetch the title and the published date for BlogPost type in search results.

GraphQL
query { search(text: "GraphQL") { __typename ... on BlogPost { [1] [2] } } }
Drag options to blanks, or click blank then click option'
Atitle
BpublishedDate
Cauthor
Dsummary
Attempts:
3 left
πŸ’‘ Hint
Common Mistakes
Using author which is not requested here.
Using summary which is not the published date.
5fill in blank
hard

Fill all three blanks to fetch the name, description, and URL for Repository type in search results.

GraphQL
query { search(text: "GraphQL") { __typename ... on Repository { [1] [2] [3] } } }
Drag options to blanks, or click blank then click option'
Aname
Bdescription
Curl
Dstars
Attempts:
3 left
πŸ’‘ Hint
Common Mistakes
Using stars which is not requested here.
Mixing up the order of fields.