首页 > 解决方案 > GraphQL 和 Github

问题描述

我是 graphQL 的新手,因此,我可能做错了什么或没有完全理解某些事情。如果有人能指导我,我会很高兴的!!!

我正在尝试通过从 GH 中提取数据来开发关于 graphQL 的查询。

目标:从团队组中提取作者日期(他们最后一次在 github 上发布的时间)。

完成:我能够从一个组织和每个团队的成员那里获得所有 12 个团队的名称,但是我无法输出他们上次提交讨论的日期,我尝试使用 (updatedAt) 但这不是我想要的为了。

输出:

{
  "data": {
    "organization": {
      "teams": {
        "edges": [
          {
            "node": {
              "name": "Computer",
              "description": "value.",
              "members": {
                "edges": [
                  {
                    "node": {
                      "name": "W A",
                      "url": "https://github.com/WA"
                    }
                  },
                  {
                    "node": {
                      "name": "V A",
                      "url": "https://github.com/v87"
                    }
                  },
                  {
                    "node": {
                      "name": "A",
                      "url": "https://github.com/A9"
                    }
                  },
                  {
                    "node": {
                      "name": "N F",
                      "url": "https://github.com/NF"
                    }
                  },
                  {
                    "node": {
                      "name": null,
                      "url": "https://github.com/N"
                    }
                  },
                  {
                    "node": {
                      "name": null,
                      "url": "https://github.com/R"
                    }
                  }
                ]
              }
            }
          },
          {
            "node": {
              "name": "Leadership Team",
              "description": "leadership positions.",
              "members": {
                "edges": [
                  {
                    "node": {
                      "name": "W S",
                      "url": "https://github.com/WS
                    }
                  },

代码:

{
  organization(login: "...") {
    teams(first: 20) {
      edges {
        node {
          name
          description
          members {
            edges {
              node {
                name
                url               
                
              }
            }
          }
        }
      }
    }
  }
}

标签: githubgraphql

解决方案


推荐阅读