Complete the code to define a GraphQL type with a non-nullable String field called 'name'.
type User { name: [1] }The exclamation mark ! after String means the field is non-nullable, which is required here.
Complete the code to add a description to the 'User' type using GraphQL schema comments.
"""[1]""" type User { id: ID! }
Triple quotes """""" are used to add descriptions in GraphQL schemas. The description should explain the type.
Fix the error in the schema by completing the code to define a list of non-nullable 'Post' types inside 'User'.
type User { posts: [[1]]! }The Post! inside the list means each post cannot be null. The list itself is non-nullable because of the exclamation mark after the brackets.
Fill both blanks to define a mutation 'createUser' that takes a non-nullable 'name' argument of type String and returns a 'User'.
type Mutation { createUser(name: [1]): [2] }The argument 'name' must be a non-nullable String, so use String!. The mutation returns a User type.
Fill all three blanks to define a query 'getUser' that takes a non-nullable 'id' argument of type ID and returns a nullable 'User'.
type Query { getUser(id: [1]): [2] }The 'id' argument must be a non-nullable ID, so use ID!. The query returns a nullable User, so no exclamation mark after User.