Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.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 compose mongoose对graphql模式中的查询进行分组_Graphql_Graphql Js_Graphql Compose_Graphql Compose Mongoose - Fatal编程技术网

使用graphql compose mongoose对graphql模式中的查询进行分组

使用graphql compose mongoose对graphql模式中的查询进行分组,graphql,graphql-js,graphql-compose,graphql-compose-mongoose,Graphql,Graphql Js,Graphql Compose,Graphql Compose Mongoose,我试图整理我的模式,以便将与某个实体相关的查询分组在一起。 我正在使用graphql compose mongoose从mongoose模型生成graphql模式 因此,我们的想法是转变: schemaComposer.Query.addFields({ entityById: EntityTC.getResolver("findById"), entityByIds: EntityTC.getResolver("findByIds"), en

我试图整理我的模式,以便将与某个实体相关的查询分组在一起。 我正在使用graphql compose mongoose从mongoose模型生成graphql模式

因此,我们的想法是转变:

schemaComposer.Query.addFields({
  entityById: EntityTC.getResolver("findById"),
  entityByIds: EntityTC.getResolver("findByIds"),
  entityOne: EntityTC.getResolver("findOne"),
  entityMany: EntityTC.getResolver("findMany"),
  entityCount: EntityTC.getResolver("count"),
  entityConnection: EntityTC.getResolver("connection"),
  entityPagination: EntityTC.getResolver("pagination"),
  
});
进入

要将graphql查询转换为:

query untidyQuery{
  entityById(_id: "abab") {
    name
    kind
  }
}
致:

然而,虽然untidyQuery返回fine,但tidyQuery返回null

有什么建议吗

query untidyQuery{
  entityById(_id: "abab") {
    name
    kind
  }
}
query tidyQuery{
  entity {
    entityById(_id: "ababab") {
      name
      kind
    }
  }
}