Complete the code to define a GraphQL object type named 'Book'.
type Book[1] {
id: ID!
title: String!
author: String!
}The GraphQL object type definition uses curly braces {} to enclose fields.
Complete the code to specify that the 'id' field is non-nullable.
type User {
id: ID[1]
name: String
}The exclamation mark ! in GraphQL means the field cannot be null.
Fix the error in the object type definition by completing the code.
type Author {
id: ID!
name: String!
books: [Book][1]
}The exclamation mark after the list type means the list itself cannot be null.
Fill both blanks to define a 'Query' type with a field 'book' that takes an 'id' argument of type 'ID!'.
type Query {
book(id: [1]): Book[2]
}The argument 'id' must be non-nullable ID!, and the return type 'Book' is non-nullable with !.
Fill all three blanks to define a 'Mutation' type with a 'createBook' field that takes 'title' and 'author' arguments as non-nullable strings and returns a non-nullable 'Book'.
type Mutation {
createBook(title: [1], author: [2]): Book[3]
}Both 'title' and 'author' arguments are non-nullable strings String!, and the return type 'Book' is non-nullable with !.