Skip to content

GraphQL API returning a specific file's text at a commit #24465

Discussion options

You must be logged in to vote

Hi @benjaminwinokur!

I believe this can be done by mashing up your first and second query by using the OID and the path to the file, something like this:

query {
  repository(owner: "blah", name: "blah") {
    folder: object(expression: "$OID:README.md") {
      ... on Blob {
        text
      }
    }
  }
}

Using this I was able to get the contents of the README at any commit, let me know if that works for you!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants