Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Graphql GraphTool中的一个关系使部署无故失败_Graphql_Graphcool - Fatal编程技术网

Graphql 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”) } 以前位置是一个

我在我的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”)
 }
以前位置是一个字符串,但现在我希望它是一个对象,所以我创建了这个关系,这样我就可以使用嵌套的突变。部署时会出现以下错误:

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”)
 }