API Reference

Custom Scalars

Non-standard GraphQL types used in the flex.plane schema: Time, Duration, Int64, and Map.

The flex.plane schema extends GraphQL's built-in scalar types with four custom scalars. These handle common data types that standard GraphQL does not cover natively.

Time

Represents a point in time, serialized as an ISO 8601 string in UTC.

Format: YYYY-MM-DDTHH:mm:ssZ

{
  "createdAt": "2025-09-15T14:30:00Z",
  "start": "2025-09-15T08:00:00Z"
}

Used in backup timestamps, audit log events, snapshot dates, cluster creation times, and file modification times.

When sending Time values as input (e.g., in filters), use the same ISO 8601 format. The timezone must be UTC (indicated by the trailing Z).

Some Time fields are nullable (e.g., VMSnapshot.date is null for the current snapshot). Always handle the null case in your client code.

Duration

Represents a time duration, serialized as a Go-style duration string.

Format: A sequence of decimal numbers with unit suffixes: h (hours), m (minutes), s (seconds).

{
  "uptime": "72h15m30s"
}

Common examples:

DurationMeaning
"0s"Zero (just started or stopped)
"45m12s"45 minutes and 12 seconds
"24h0m0s"Exactly one day
"168h0m0s"One week

Used primarily in VM.uptime and Host.uptime fields. The duration represents wall-clock time since the resource was last started.

When displaying durations to users, you will likely want to parse the string and reformat it. For example, "168h0m0s" is more readable as "7 days" and "2562h15m" as "106 days, 18 hours".

Int64

Represents a 64-bit integer. GraphQL's built-in Int type is limited to 32 bits (max ~2.1 billion), which is not enough for byte-level storage sizes.

Format: Serialized as a JSON number.

{
  "size": 107374182400,
  "used": 53687091200
}

Used in disk sizes, storage pool capacities, memory values, and network I/O counters where values can exceed 2 GB.

Field exampleTypical range
Disk.sizeBytes (e.g., 107374182400 = 100 GiB)
DiskUsage.usedBytes
StoragePool.availableBytes
VirtualDatacenterQuota.maxMemoryMiBMebibytes
NetworkUsage.totalInBytes
Some JSON parsers (notably JavaScript's JSON.parse) lose precision for integers larger than 2^53. If you work with very large storage values, use a BigInt-aware JSON parser or handle the values as strings on the client side.

Map

Represents an arbitrary key-value map, serialized as a JSON object.

Format: A flat JSON object with string keys and string values.

{
  "metadata": {
    "env": "production",
    "team": "platform",
    "cost-center": "engineering"
  }
}

The Map scalar is used sparingly in the schema for flexible metadata where a strict type definition would be unnecessarily rigid. Unlike typed GraphQL objects, the keys in a Map are not defined in the schema and can vary between instances.