时间类型

这是 GraphQL 库版本 6 的文档。对于长期支持 (LTS) 版本 5,请参阅 GraphQL 库版本 5 LTS

类型 描述 示例

DateTime

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

type User @node {
    createdAt: DateTime
}

日期

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

type Movie @node {
    releaseDate: Date
}

持续时间

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

目前不接受 [YMWD] 上的十进制值。比较根据 Cypher 开发人员指南 进行。

type Movie @node {
    runningTime: Duration!
}

LocalDateTime

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

type Movie @node {
    nextShowing: LocalDateTime
}

时间

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

type Movie @node {
    nextShowing: Time
}

LocalTime

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

type Movie @node {
    nextShowing: LocalTime
}