Graphql GraphTool中的一个关系使部署无故失败
我在我的GraphTool中创建了这个关系Graphql GraphTool中的一个关系使部署无故失败,graphql,graphcool,Graphql,Graphcool,我在我的GraphTool中创建了这个关系 type User @model { id: ID! @isUnique location: Location! @relation(name: "UserLocation") } type Location @model { id: ID! @isUnique lat: Int lng: Int User: User! @relation(name: "UserLocation”) } 以前位置是一个
type User @model {
id: ID! @isUnique
location: Location! @relation(name: "UserLocation")
}
type Location @model {
id: ID! @isUnique
lat: Int
lng: Int
User: User! @relation(name: "UserLocation”)
}
以前位置是一个字符串,但现在我希望它是一个对象,所以我创建了这个关系,这样我就可以使用嵌套的突变。部署时会出现以下错误:
There are issues with the new service definition:
Global
✖ None.get
我在谷歌上搜索,查看文档,但我不明白我做错了什么,这是一个简单的关系 在更改字段类型时也会遇到类似的问题。不确定这种行为的原因(看起来像是GraphTool问题),但要解决它们,可以将其分为两个步骤: 1) 从GraphTool架构中删除此关系:
type User @model {
id: ID! @isUnique
# location: Location! @relation(name: "UserLocation")
}
type Location @model {
id: ID! @isUnique
lat: Int
lng: Int
# User: User! @relation(name: "UserLocation”)
}
2) 使用新类型还原关系字段:
type User @model {
id: ID! @isUnique
location: Location! @relation(name: "UserLocation")
}
type Location @model {
id: ID! @isUnique
lat: Int
lng: Int
User: User! @relation(name: "UserLocation”)
}