时间类型

这是 GraphQL Library 7 版本的文档。对于长期支持 (LTS) 版本 5,请参考 GraphQL Library 5 LTS 版本

类型 描述 示例

DateTime

ISO 日期时间字符串存储为 datetime 时间类型。

type User @node {
    createdAt: DateTime
}

Date

“YYYY-MM-DD” 日期字符串存储为 date 时间类型。

type Movie @node {
    releaseDate: Date
}

Duration

ISO 8601 持续时间字符串存储为 duration 类型。

当前不接受对 [YMWD] 使用十进制值。比较方式遵循 Cypher 开发者指南

type Movie @node {
    runningTime: Duration!
}

LocalDateTime

“YYYY-MM-DDTHH:MM:SS” 日期时间字符串存储为 LocalDateTime 时间类型。

type Movie @node {
    nextShowing: LocalDateTime
}

Time

RFC3339 时间字符串存储为 Time 时间类型。

type Movie @node {
    nextShowing: Time
}

LocalTime

“HH:MM:SS[.sss+]” 时间字符串存储为 LocalTime 时间类型。

type Movie @node {
    nextShowing: LocalTime
}