简体   繁体   English

节点 express-graphql 应用程序中使用的 Prisma 2 DateTime 字段

[英]Prisma 2 DateTime field used in a node express-graphql application

I can't seem to find how to manage DateTime field in prisma 2 to node express-graphql app.我似乎无法找到如何管理 Prisma 2 中的 DateTime 字段来节点 express-graphql 应用程序。 If I set the field type to string in graphql.schema it just changes the value to fit the 32 bit representation.如果我在 graphql.schema 中将字段类型设置为字符串,它只会更改值以适应 32 位表示。 What are the options?有什么选择? I insert the datetime into the database with moment().toDate()我使用 moment().toDate() 将日期时间插入数据库

Follow this part and create a Date scalar so that you can pass it directly as:按照部分创建一个 Date 标量,以便您可以直接将其传递为:

input Something {
  value: Date
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM