我尝试使用下面的代码使用我的 github 帐户创建组织,但出现错误
mutation { createOrganization(input: { login: "besttestzzzz", admin: true }) { organization { id login } } }
{ "input": { "admin": [ "testgithubaccount" ],
"clientMutationId": "",
"login": "testgithubaccount"
} }
我遇到错误,请查看下图。
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