在 prisma 中表示没有 id 的类型的最佳方式是什么?

inv*_*ant 5 graphql prisma

数据模型.graphql

type Data {
  id: ID! @unique
  createdAt: DateTime!
  updatedAt: DateTime!
  points:[Point!]!
}

type Point {
 x:Float!
 y:Float!
}
Run Code Online (Sandbox Code Playgroud)

生成的类型(prisma.graphql):

type Data implements Node {
  id: ID!
  points(where: PointWhereInput, orderBy: PointOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Point!]
}
Run Code Online (Sandbox Code Playgroud)

在我的数据模型中points是必填字段,但在生成的 prisma 类型中points是可选字段?当我更新数据点时,以前的数据也会出现在结果中(https://github.com/prisma/prisma/issues/1657)..

我看到的解决方法是Json,但我们在 codegen 和 graphiql 中失去了类型安全性:(,

prisma 是否会在实现中默认将type没有字段的情况处理为 Json ...?id