Complete the code to define a list of integers in GraphQL schema.
type Query { numbers: [[1]] }The list type in GraphQL is defined by wrapping the type in square brackets. Here, Int is the correct scalar type for integers.
Complete the code to define a list of non-nullable strings in GraphQL schema.
type Query { names: [[1]!] }The exclamation mark ! after the type means the list elements cannot be null. Here, String is the correct scalar type for text.
Fix the error in the list type definition to make the list itself non-nullable but allow nullable elements.
type Query { items: [1] }To make the list non-nullable but allow nullable elements, place the exclamation mark after the closing bracket: [String]!.
Fill both blanks to define a list of non-nullable integers where the list itself is also non-nullable.
type Query { scores: [1][2] }The correct syntax for a non-nullable list of non-nullable integers is [Int!]!. The list is wrapped in brackets with exclamation marks after the type and after the brackets.
Fill both blanks to define a GraphQL input type with a field that is a non-nullable list of nullable floats.
input FilterInput { values: [1][2] }The field values is a non-nullable list (] followed by !) of nullable floats (Float without exclamation mark). So the correct syntax is [Float]!.