如何从Github Graphql API获取Readme.MD? [英] How to get Readme.MD from Github Graphql API?

查看:99
本文介绍了如何从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
      }
    }
  }
}

这篇关于如何从Github Graphql API获取Readme.MD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆