1

我在我的graphcool中创建了这个关系

 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

我用谷歌搜索,查看了文档,但我无法理解我做错了什么,这是一个简单的关系。

4

1 回答 1

3

在更改字段类型时也面临这样的问题。不确定这种行为的原因是什么(看起来像是一个graphcool问题),但要解决它们,您可以将其分为两个步骤:

1)从graphcool模式中删除这个关系:

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”)
 }
于 2018-08-10T12:51:10.383 回答