使用 graphql 创建 Github 组织

问题描述 投票:0回答:1

我尝试使用下面的代码使用我的 github 帐户创建组织,但出现错误

mutation { createOrganization(input: { login: "besttestzzzz", admin: true }) { organization { id login } } }

{ "input": { "admin": [ "testgithubaccount" ],

"clientMutationId": "",
"login": "testgithubaccount"

} }

我遇到错误,请查看下图。

github graphql postman github-api github-graphql
1个回答
0
投票

GitHub 的 GraphQL API 不提供创建组织的直接端点。组织创建通常通过 GitHub Web 界面或使用 REST API 完成。

Here's how you can use rest API:

curl -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -d '{
  "login": "new-org",
  "profile_name": "New Organization",
  "admin": "your-username"
}' https://api.github.com/user/repos
© www.soinside.com 2019 - 2024. All rights reserved.