Skip to main content

Scalars

The fundamental building-block in the type system. Standard GraphQLScalarTypes: String, Int, Float, Boolean and ID types are already implemented and provided by Leto.

GraphQL Specification

Other scalar types are also provided:

  • Json: A raw JSON value with no type schema. Could be a Map<String, Json>, List<Json>, num, String, bool or null.
  • Uri: Dart's Uri class, serialized using Uri.toString and deserialized with Uri.parse
  • Date: Uses the DateTime Dart class. Serialized as an ISO-8601 String and deserialized with DateTime.parse.
  • Timestamp: Same as Date, but serialized as an UNIX timestamp.
  • Time: // TODO: 1A
  • Duration: // TODO: 1A
  • BigInt: An arbitrarily large integer from dart:core serialized as a String and deserialized with BigInt.parse.
  • Upload: A file upload. Following the multipart request spec.

To provide your own or support types from other packages you can use Custom Scalars.