The type system
GraphQL is a strongly-typed language, and a GraphQL schema should have types for all objects that it uses. This includes properties on objects, arguments, and variables. The type system allows a GraphQL server to determine whether a query is valid at runtime.
Scalars and object types
GraphQLFieldConfig object defines a field's type property to be
GraphQLOutputType. An output type in GraphQL can be one of the following three things:
- A custom type, like the
EmployeeTypewhich we defined in a previous example.
GraphQLScalarType, which represents a scalar value that cannot have fields of its own. This could be one of the following:
GraphQLIntto represent an integer value
GraphQLFloatto represent a float value
GraphQLStingto represent ...