postman 使用graphql创建Github组织

6yt4nkrj  于 8个月前  发布在  Postman
关注(0)|答案(1)|浏览(79)

我尝试下面的代码来创建组织使用我的github帐户得到错误
mutation { createOrganization(input: { login: "besttestzzzz", admin: true }) { organization { id login } } }
{ "input": { "admin": [ "testgithubaccount" ],

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

} }
我得到错误查看下面的图像.

kq0g1dla

kq0g1dla1#

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

相关问题