0
0
GraphQLquery~10 mins

List 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 define a list of integers in GraphQL schema.

GraphQL
type Query { numbers: [[1]] }
Drag options to blanks, or click blank then click option'
AString
BInt
CBoolean
DFloat
Attempts:
3 left
💡 Hint
Common Mistakes
Using String instead of Int for a list of numbers.
Forgetting to use square brackets for list types.
2fill in blank
medium

Complete the code to define a list of non-nullable strings in GraphQL schema.

GraphQL
type Query { names: [[1]!] }
Drag options to blanks, or click blank then click option'
AInt
BBoolean
CString
DFloat
Attempts:
3 left
💡 Hint
Common Mistakes
Using Int instead of String for text lists.
Placing the exclamation mark outside the brackets instead of after the type.
3fill in blank
hard

Fix the error in the list type definition to make the list itself non-nullable but allow nullable elements.

GraphQL
type Query { items: [1] }
Drag options to blanks, or click blank then click option'
AString
BString!
C[String!]
D[String]!
Attempts:
3 left
💡 Hint
Common Mistakes
Putting exclamation mark after the type instead of after the list.
Using String! without brackets which is not a list.
4fill in blank
hard

Fill both blanks to define a list of non-nullable integers where the list itself is also non-nullable.

GraphQL
type Query { scores: [1][2] }
Drag options to blanks, or click blank then click option'
A[
BInt!
C]!
DInt
Attempts:
3 left
💡 Hint
Common Mistakes
Placing exclamation marks in the wrong positions.
Forgetting to wrap the type in brackets.
5fill in blank
hard

Fill both blanks to define a GraphQL input type with a field that is a non-nullable list of nullable floats.

GraphQL
input FilterInput { values: [1][2] }
Drag options to blanks, or click blank then click option'
A[
BFloat
C]!
DFloat!
Attempts:
3 left
💡 Hint
Common Mistakes
Using Float! inside the list which makes elements non-nullable.
Placing exclamation mark after the type instead of after the brackets.