datamodel.graphql
[DebuggerDisplay("Count = {count}")]
class MyHashtable
{
public int count = 4;
}
生成的类型(prisma.graphql):
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
在我的数据模型type Data {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
points:[Point!]!
}
type Point {
x:Float!
y:Float!
}
中的是必填字段,但在生成的棱柱形中,类型type Data implements Node {
id: ID!
points(where: PointWhereInput, orderBy: PointOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Point!]
}
是可选的吗?并且当我更新数据的点时,以前的数据也会出现在结果(https://github.com/prisma/prisma/issues/1657)中。
解决方法,我看到的是points
,但是我们在代码生成和graphiql中松了类型安全性:(,
在实现中,prisma是否默认将没有points
字段的Json
处理为Json ...?