I'm trying to get repositories of user with login name "somelogin".
It returns all repositories but I'm trying to get repositories owned by him only. Because new API uses GraphQL I couldn't did it.
Currently I'm using:
{
"query": "query { user(login:\"furknyavuz\") {repositories(first: 50) { nodes { name url }}}}"
}
You can use the GitHub GraphQL API to create precise and flexible queries for the data you need to integrate with GitHub. Learn about the GitHub GraphQL API, previews for upcoming changes, breaking changes, and limitations. You can also use the GraphQL Explorer to interact with the API on real GitHub data.
To create integrations, retrieve data, and automate your workflows, use the GitHub GraphQL API. The GitHub GraphQL API offers more precise and flexible queries than the GitHub REST API.
The GitHub GraphQL API supports several mutation operations to change data on the server. We will use the addComment mutation to add a comment to the issue. In the GitHub API, elements such as issues, pull requests, and users are nodes.
Basically a repository is the place for application source code that can be shared with others. I encourage you to put a few of your projects into GitHub repositories, so you can access them all later with what you've learned about their GraphQL API.
You can use isFork: false
to exclude fork. In the explorer :
{
user(login: "furknyavuz") {
repositories(first: 50, isFork: false) {
nodes {
name
url
}
}
}
}
With curl :
curl -H "Authorization: bearer token" -d '
{
"query": "query { user(login: \"furknyavuz\") { repositories(first: 50, isFork: false) { nodes { name url } } } }"
}
' https://api.github.com/graphql
It's super easy to build graph QL using the Github GraphQL explorer. Please refer to the attached screenshot. https://docs.github.com/en/graphql/overview/explorer
{ user(login: "leerob") { name email company bio followers { totalCount } following { totalCount } repositories(first: 50, isFork: false) { nodes { name url stargazerCount primaryLanguage { id name } } } } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With