如何在没有Node和Edge关键字的情况下查询GraphQL?

时间:2019-11-28 12:14:00

标签: graphql graphene-python

因此,我构建了一个简单的GraphQL API,每次需要对其进行查询时,都需要进行如下查询:

query{
   allUser{
     edges{
       node{
           id
           username
           age
        }
     }
    }
 }

所以数据结果如下:

 "data": {
    "allUser": {
      "edges": [
        {
          "node": {
            "id": "VXNlcjpOb25l",
            "username": "abc",
            "age": 12
          }
        },.....and other data 

因此每次我需要在查询中使用edgesnode时,我希望查询看起来像这样

query{
  allUser{
     id
     username
     age
  }
}

并且数据响应中没有edgesnode

我使用FlaskGraphene-Mongo,如何完成上述任务?

0 个答案:

没有答案