Enumeration Types
Enumeration Types are also called as “Enum” Types and it is used when there is only one predefined set of values for a field. It is restricted to a particular set of allowed values. It is similar to Scalar Types and Enum allows only if the conditions below are satisfied.
- If a argument is one of the allowed value then it can validate
- A field will be a finite set of values, when it communicates through the type system
Synatx:
type ENUM_name{
value1
value2
value3
}
Example:
type Relationship {
SINGLE
COMMITTED
ENGAGED
}
Types in GraphQL
GraphQL is a strongly typed query language used as a manipulative language for various APIs. It is also called a query language for APIs. GraphQL also helps to describe our data. GraphQL services can run in any language In this, Types are the fundamental concepts that define various data types present in GraphQL and It is also used to define the schema using different data types. There are multiple types in GraphQL.