Skip to main content
Version: 0.6.x

Supported scalars

Scalars represent the leaf values in the graph, either as part of key-value properties in shapes, or value of items in lists. You can learn more about scalars in the GraphQL specification.

Primitive types

The following scalars are part of the GraphQL specification.

Boolean

A true or false value.

Int

A signed 32-bit integer.

A range of valid values can be defined using the @int directive.

Float

A signed double-precision floating-point value.

A range of valid values can be defined using the @float directive.

String

A UTF-8 character sequence.

caution

The @string directive must be used along with String scalars to define the maxLength of the string.

Identifiers

The following scalars represent unique identifiers in the graph. In ComposedDB, they are all stored as string values.

ID

A Node identifier used by GraphQL.

tip

By default, IDs are configured with a maxLength of 100. The @string directive can be used along with ID scalars to define a different maxLength as needed.

DID

A Decentralized Identifier, representing an actor able to create and mutate Documents in the graph, using GraphQL Scalars.

StreamID

Identifies a specific Stream in the Ceramic network, following the StreamID specification.

CommitID

Identifies a specific version of a Stream in the Ceramic network, following the CommitID specification.

CID

A Content Identifier, as used by IPFS.

ChainID

A Chain Agnostic Chain Identifier, as specified by Chain Agnostic CAIP-2.

AccountID

A Chain Agnostic Account Identifier, as specified by Chain Agnostic CAIP-10.

URI

RFC 3986 compliant URI string, such as https://ceramic.network.

Date and time

The following scalars can be used to store date and time values using standard representations.

Date

RFC 3339 compliant date string without time information, such as 2007-12-03, using GraphQL Scalars.

DateTime

A date-time string at UTC, such as 2007-12-03T10:15:30Z, using GraphQL Scalars.

Time

A time string at UTC, such as 10:15:30Z, using GraphQL Scalars.

LocalDate

A local date string (with no associated timezone) in YYYY-MM-DD format, such as 2007-12-03, using GraphQL Scalars.

LocalTime

A local time string (i.e., with no associated timezone) in 24-hr HH:mm[:ss[.SSS]] format, such as 14:25, 14:25:06 or 14:25:06.123, using GraphQL Scalars.

TimeZone

Standard IANA time zone, using GraphQL Scalars.

UTCOffset

A string with format ±hh: mm, using GraphQL Scalars.

Duration

ISO 8601 duration string, such as P1W1DT13H23M34S, using GraphQL Scalars.

Geography and internationalization

Latitude

Decimal degrees latitude number, using GraphQL Scalars.

Longitude

Decimal degrees longitude number, using GraphQL Scalars.

CountryCode

ISO 3166-1 alpha-2 country code string, using GraphQL Scalars.

Locale

RFC 5646 locale string, such as en-GB, using GraphQL Scalars.