【问题标题】:Github GraphQL list repo permissions for a Team团队的 Github GraphQL 列表 repo 权限
【发布时间】:2021-09-22 15:53:30
【问题描述】:

我真的很难从 GitHub GraphQL api 中获得任何有意义的东西...... 我想获得一个 repos 列表和团队的权限级别。到目前为止我有

Q= """query {
  organization(login: "MY_ORG") {
      team(slug:"MY_TEAM") {
          name
          repositories(first:3){
              nodes {
                  name
              }
              edges {
                  permission
              }
          }
      }
  }
}"""

返回

{'data': {'organization': {'team': {'name': 'MY_TEAM',
'repositories': {'nodes': [{'name': 'REPO1'},
  {'name': 'REPO2'},
  {'name': 'REPO3'}],
 'edges': [{'permission': 'ADMIN'},
  {'permission': 'ADMIN'},
  {'permission': 'ADMIN'}]}}}}}

但是我看不到任何将权限和存储库名称一起列出的方法,因为无法从 teamrepositoryedge 到存储库节点,反之亦然:/

我觉得我错过了一些明显的东西,只是没有看到它。

【问题讨论】:

    标签: github graphql github-api github-graphql


    【解决方案1】:

    最终发现边缘中有一个节点,它只是没有像其他人一样记录在案:(

    query {
    organization(login: "MY_ORG") {
        team(slug:"MY_TEAM"){
            name
            repositories(first:3){
                edges {
                    permission
                    node {
                        name
                    }
                }
            }
        }
    }
    }
    
    {'data': {'organization': {'team': {'name': 'MY_TEAM',
    'repositories': {'edges': [{'permission': 'ADMIN',
       'node': {'name': 'REPO1'}},
      {'permission': 'ADMIN', 'node': {'name': 'REPO2'}},
      {'permission': 'ADMIN', 'node': {'name': 'REPO3'}}]}}}}}
    

    【讨论】:

      猜你喜欢
      • 2011-04-17
      • 1970-01-01
      • 2021-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多