In GraphQL, there are three types of variables that are allowed:
- Scalar Variables: These variables can hold any scalar value such as Int, Float, String, Boolean, or ID. These are the most commonly used variables in GraphQL.
- Enum Variables: Enum variables can hold one of a predefined set of values. Enum types are useful when you have a fixed set of options to choose from.
- Input Object Variables: Input object variables are used when you want to pass a complex object as an argument. These variables allow you to define a specific shape or structure for the input object.
It's worth noting that in addition to these basic variable types, GraphQL also allows you to use custom scalar types as variables. This provides flexibility in handling specific types of data.