如何从Github Graphql API获取Readme.MD?
问题描述:
v3具有用于检索readme.md文件的特定API.但是在新的V4 GraphQL中,存储库对象中没有此类字段.
The v3 has a specific API for retrieving the readme.md file. But in the new V4 GraphQL, there is no such field in the Repository Object.
有人知道如何检索自述文件吗?
Does anyone know how to retrieve the readme file?
谢谢!
答
尚无一个特定的实体来获取README.md文件,但是您可以像通常检索任何其他文件一样来检索它:
There is not yet a specific entity to get the README.md file, but you can retrieve it as you would normally retrieve any other file:
{
repository(owner: "gitpoint", name: "git-point") {
object(expression: "master:README.md") {
... on Blob {
text
}
}
}
}