Initial types
A GraphQL schema includes types, indicating where query and mutation operations start. This provides the initial entry points into the type system. The query type must always be provided, and is an Object base type. The mutation type is optional; if it is null, that means the system does not support mutations. If it is provided, it must be an object base type.
The fields on the query type indicate what fields are available at the top level of a GraphQL query. For example, a basic GraphQL query like this one:
query getMe {
me
}
Is valid when the type provided for the query starting type has a field named “me”. Similarly
mutation setName {
setName(name: "Zuck") {
newName
}
}
Is valid when the type provided for the mutation starting type is not null, and has a field named “setName” with a string argument named “name”.