Neither the official graphql guide, nor the howtographql tutorial, specifies a consistent bucketing / hierarchy of types.
From the Official "Learn" GraphQL:
The most basic components of a GraphQL schema are object types
...
Most types in your schema will just be normal object types, but there are two types that are special within a schema: Query, Mutation. [my note: Here they forgot subscription]
...
Except for being "entry point" into schema, Query and Mutation types are the same as any other GraphQL object type, and their fields work exactly the same way
...
That's where the scalar types come in: they represent the leaves of the query
...
Enumeration types are a special kind of scalar
...
Object types, scalars, and enums are the only kinds of types you can define in GraphQL. [my note: That is not entirely correct, as enums are special scalar types]
...
An Interface is an abstract type
...
Union types are very similar to interfaces
...
Input types look exactly the same as regular object types, but with the keyword input instead of type
From HowToGraphQL:
In GraphQL, there are two different kinds of types.
Scalar types
Object types
...
enums are special kinds of scalar types.
...
An interface can be used to describe a type in an abstract way.
...
Union types can be used to express that a type should be either of a collection of other types.
My Best Guess
- There only exists two types in GraphQL:
- Object type
- Scalar type
- Object type includes
- Custom object types
- 3 special object types: Query, Mutation, Subscription
- Scalar type includes
- 5 built-in scalar types
- Custom scalar types
- Enumeration type
- Interface and Union
- These are not actually types
- They are mechanisms used to describe object types
- Input type
- Again, not actually a type
- It is a mechanism through which object and scalar types can be used as inputs in queries
Question
Is there a correct (official) bucketing? Is my "best guess" above correct?