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

时间:2018-08-22 05:03:20

标签: graphql prisma

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 ...?

0 个答案:

没有答案