0
0
GraphQLquery~10 mins

Schema documentation 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 define a GraphQL type with a description.

GraphQL
type Book { id: ID! title: String! [1] description: String }
Drag options to blanks, or click blank then click option'
A"A brief summary of the book"
B@deprecated(reason: "Use summary instead")
C@doc(description: "Book description")
D"This is the book description"
Attempts:
3 left
💡 Hint
Common Mistakes
Using directives like @deprecated instead of a description string.
Not using quotes around the description.
2fill in blank
medium

Complete the code to add a description to the entire GraphQL schema.

GraphQL
"[1]" schema { query: Query }
Drag options to blanks, or click blank then click option'
ALibrary API schema
BSchema for the library system
CThis is the schema description
DMain schema for queries
Attempts:
3 left
💡 Hint
Common Mistakes
Placing the description after the schema keyword.
Not using quotes around the description.
3fill in blank
hard

Fix the error in the code to properly document a field with a description.

GraphQL
type Author { [1] name: String! }
Drag options to blanks, or click blank then click option'
A"Author's full name"
B@doc("Author's name")
C"Author full name"
D@description("Author's full name")
Attempts:
3 left
💡 Hint
Common Mistakes
Using directives instead of string descriptions.
Missing quotes around the description.
4fill in blank
hard

Fill both blanks to add descriptions to a GraphQL enum and its values.

GraphQL
enum Color [1] { [2] RED GREEN BLUE }
Drag options to blanks, or click blank then click option'
A"Colors available in the system"
B"The color red"
C"Primary colors"
D"Represents red color"
Attempts:
3 left
💡 Hint
Common Mistakes
Not adding quotes around descriptions.
Placing descriptions in wrong positions.
5fill in blank
hard

Fill all three blanks to add descriptions to a GraphQL input type and its fields.

GraphQL
input UserInput [1] { [2] username: String! [3] age: Int }
Drag options to blanks, or click blank then click option'
A"Input data for a user"
B"The user's login name"
C"The user's age in years"
D"User input type"
Attempts:
3 left
💡 Hint
Common Mistakes
Using directives instead of string descriptions.
Forgetting quotes around descriptions.