GraphQL specification defines 5 built-in scalar types -
ID (a string with a unique identifier). These types are JSON serializable and available in every programming language.
Be careful with the built-in scalar
signed 32-bit integer.
-2^31or greater than or equal to
2^31, a field error should be raised.
These numbers in real life:
If you return from the backend or pass via client an argument whose value is not within the
32-bit Int interval - you'll get an error: Int cannot represent non-32-bit signed integer value.
However, when a scalar type is not representable in JSON by default (e.g.
Date) the backend has to figure out a data format that can be serializable and transmittable via JSON. The backend also needs to deserialize the field received from a client.
In such cases, GraphQL allows you to create your own custom scalar types.