使用 graphql github api 通过 Id 获取提交信息
using graphql github api to get commit information by Id
我想获取特定提交的提交详细信息,因为我已经有了提交 ID
例如,如果我知道提交 ID 是
12762b76cba8ac4623a6c16e1fe60efafa3b7d1c
并且回购是 ruby/ruby
如何获取提交日期和作者电子邮件?
您可以尝试使用 cursor as an edge type, as in this thread:
{
repository(owner: "octocat", name: "Hello-World") {
first: object(expression: "master") {
... on Commit {
history(path: "README", last: 1, before: "762941318ee16e59dabbacb1b4049eec22f0d303 1") {
edges {
node {
committedDate
oid
author
{
email
}
}
}
}
}
}
}
}
您可以使用此资源管理器对其进行测试https://developer.github.com/v4/explorer/
我想获取特定提交的提交详细信息,因为我已经有了提交 ID
例如,如果我知道提交 ID 是
12762b76cba8ac4623a6c16e1fe60efafa3b7d1c
并且回购是 ruby/ruby
如何获取提交日期和作者电子邮件?
您可以尝试使用 cursor as an edge type, as in this thread:
{
repository(owner: "octocat", name: "Hello-World") {
first: object(expression: "master") {
... on Commit {
history(path: "README", last: 1, before: "762941318ee16e59dabbacb1b4049eec22f0d303 1") {
edges {
node {
committedDate
oid
author
{
email
}
}
}
}
}
}
}
}
您可以使用此资源管理器对其进行测试https://developer.github.com/v4/explorer/