How can I get all information about repository using API?<title> #38768
Replies: 3 comments
-
Hi there @Shakikhanli and welcome to our community! Thank you for asking a great question 🙂 To get started, introduce yourself in our official introduction thread |
Beta Was this translation helpful? Give feedback.
-
Example junegunn/fzf-git.sh
GraphQL query{
repository(owner: "junegunn", name: "fzf-git.sh") {
issues(first: 100) {
nodes {
author {
login
}
createdAt
number
}
}
pullRequests(first: 100) {
nodes {
author {
login
}
createdAt
number
}
}
refs(first: 100, refPrefix: "refs/heads/") {
nodes {
name
target {
... on Commit {
tree {
entries {
name
type
object {
... on Tree {
entries {
name
}
}
}
}
}
history(first: 100) {
nodes {
abbreviatedOid
committedDate
}
}
}
}
}
}
}
} GraphQL results{
"data": {
"repository": {
"issues": {
"nodes": [
{
"author": {
"login": "phelipetls"
},
"createdAt": "2022-08-21T13:30:40Z",
"number": 3
},
{
"author": {
"login": "phelipetls"
},
"createdAt": "2022-08-21T13:36:00Z",
"number": 4
},
{
"author": {
"login": "balta2ar"
},
"createdAt": "2022-08-26T15:20:44Z",
"number": 7
},
{
"author": {
"login": "LangLangBart"
},
"createdAt": "2022-08-27T08:26:09Z",
"number": 8
},
{
"author": {
"login": "timsu92"
},
"createdAt": "2022-08-30T07:37:17Z",
"number": 11
},
{
"author": {
"login": "tigerinus"
},
"createdAt": "2022-08-30T20:03:14Z",
"number": 12
},
{
"author": {
"login": "wookayin"
},
"createdAt": "2022-09-15T02:57:25Z",
"number": 16
},
{
"author": {
"login": "jpalus"
},
"createdAt": "2022-09-28T23:58:05Z",
"number": 17
}
]
},
"pullRequests": {
"nodes": [
{
"author": {
"login": "pbnj"
},
"createdAt": "2022-08-15T03:20:56Z",
"number": 1
},
{
"author": {
"login": "matthiasbeyer"
},
"createdAt": "2022-08-15T07:31:09Z",
"number": 2
},
{
"author": {
"login": "junegunn"
},
"createdAt": "2022-08-22T02:20:04Z",
"number": 5
},
{
"author": {
"login": "junegunn"
},
"createdAt": "2022-08-22T04:30:43Z",
"number": 6
},
{
"author": {
"login": "mathieu-lemay"
},
"createdAt": "2022-08-28T03:55:52Z",
"number": 9
},
{
"author": {
"login": "timsu92"
},
"createdAt": "2022-08-30T04:26:38Z",
"number": 10
},
{
"author": {
"login": "ptzz"
},
"createdAt": "2022-09-02T09:17:25Z",
"number": 13
},
{
"author": {
"login": "ptzz"
},
"createdAt": "2022-09-02T17:51:38Z",
"number": 14
},
{
"author": {
"login": "timsu92"
},
"createdAt": "2022-09-05T08:17:10Z",
"number": 15
},
{
"author": {
"login": "jpalus"
},
"createdAt": "2022-09-29T15:59:49Z",
"number": 18
}
]
},
"refs": {
"nodes": [
{
"name": "main",
"target": {
"tree": {
"entries": [
{
"name": ".github",
"type": "tree",
"object": {
"entries": [
{
"name": "FUNDING.yml"
}
]
}
},
{
"name": "README.md",
"type": "blob",
"object": {}
},
{
"name": "fzf-git.sh",
"type": "blob",
"object": {}
}
]
},
"history": {
"nodes": [
{
"abbreviatedOid": "9190e1b",
"committedDate": "2022-09-30T01:42:36Z"
},
{
"abbreviatedOid": "a48b941",
"committedDate": "2022-09-06T02:47:02Z"
},
{
"abbreviatedOid": "a409f05",
"committedDate": "2022-09-03T00:50:08Z"
},
{
"abbreviatedOid": "926a33d",
"committedDate": "2022-09-03T00:49:18Z"
},
{
"abbreviatedOid": "f31e8a0",
"committedDate": "2022-08-31T00:08:55Z"
},
{
"abbreviatedOid": "bfcd68d",
"committedDate": "2022-08-30T07:19:01Z"
},
{
"abbreviatedOid": "e44dfb3",
"committedDate": "2022-08-30T04:32:37Z"
},
{
"abbreviatedOid": "01cf6ba",
"committedDate": "2022-08-28T00:14:28Z"
},
{
"abbreviatedOid": "84dd4de",
"committedDate": "2022-08-27T02:09:55Z"
},
{
"abbreviatedOid": "d9c0458",
"committedDate": "2022-08-24T04:13:08Z"
},
{
"abbreviatedOid": "ca7531b",
"committedDate": "2022-08-22T13:16:33Z"
},
{
"abbreviatedOid": "c8e146e",
"committedDate": "2022-08-22T04:33:30Z"
},
{
"abbreviatedOid": "f72ebd8",
"committedDate": "2022-08-20T00:55:20Z"
},
{
"abbreviatedOid": "a5c30a5",
"committedDate": "2022-08-19T07:38:47Z"
},
{
"abbreviatedOid": "92b3c55",
"committedDate": "2022-08-19T07:34:52Z"
},
{
"abbreviatedOid": "575d0f3",
"committedDate": "2022-08-18T23:22:46Z"
},
{
"abbreviatedOid": "015b682",
"committedDate": "2022-08-18T23:15:41Z"
},
{
"abbreviatedOid": "183dead",
"committedDate": "2022-08-18T01:57:12Z"
},
{
"abbreviatedOid": "27aa7a3",
"committedDate": "2022-08-17T11:28:15Z"
},
{
"abbreviatedOid": "9d2e2b0",
"committedDate": "2022-08-17T11:26:03Z"
},
{
"abbreviatedOid": "5d53537",
"committedDate": "2022-08-17T01:01:41Z"
},
{
"abbreviatedOid": "41d66dc",
"committedDate": "2022-08-17T00:05:00Z"
},
{
"abbreviatedOid": "0712df9",
"committedDate": "2022-08-16T09:17:15Z"
},
{
"abbreviatedOid": "98345f5",
"committedDate": "2022-08-16T09:09:22Z"
},
{
"abbreviatedOid": "8b4e074",
"committedDate": "2022-08-16T09:08:29Z"
},
{
"abbreviatedOid": "f1a4f04",
"committedDate": "2022-08-16T06:01:40Z"
},
{
"abbreviatedOid": "af65501",
"committedDate": "2022-08-15T14:51:42Z"
},
{
"abbreviatedOid": "538b47d",
"committedDate": "2022-08-15T14:49:19Z"
},
{
"abbreviatedOid": "43ad68f",
"committedDate": "2022-08-15T14:48:09Z"
},
{
"abbreviatedOid": "da11f5c",
"committedDate": "2022-08-15T14:36:24Z"
},
{
"abbreviatedOid": "9867a4a",
"committedDate": "2022-08-14T14:35:22Z"
},
{
"abbreviatedOid": "4bc0323",
"committedDate": "2022-08-13T15:51:14Z"
}
]
}
}
}
]
}
}
}
} For larger repos, such as vscode it will not work with a single query, you would need
PS: Mind the Rate Limit - GitHub GraphQL API has limitations in place to protect against excessive or abusive calls to GitHub's servers Please post any success here, I'm curious to see what solution you've found to do it. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
As you know Github API gives us information about repository but if want to get more information for example "list of branches", "list of all commits" and so on then we have to send additional requests which eventually will result with the exceeding of API ratio. SO short I need to get all information about repository which is available in API by a single request. is it possible?
Beta Was this translation helpful? Give feedback.
All reactions