Trying to get an orgs private and public repositories in Postman I've attempted:
GET: https://api.github.com/graphql
Under Authorization selected:
Type: Basic Auth
I add my Github username to username
and
for password
per the docs and I place my PAT. For testing purposes I've selected everything for token creation.
Under Body I have:
query:
query ($github_login: String!, $repo_count: Int!) {
viewer {
organization(login: $github_login) {
login
id
location
name
url
repositories(first: $repo_count, privacy: PRIVATE, isFork: false) {
nodes {
id
name
openGraphImageUrl
createdAt
stargazerCount
url
description
}
}
}
}
}
variables:
{"github_login": "org-name", "repo_count": 100}
my Status is a 200 OK
but my results are not repositories but instead a long listing of null
:
"types": [
{
"kind": "INPUT_OBJECT",
"name": "AbortQueuedMigrationsInput",
"description": "Autogenerated input type of AbortQueuedMigrations",
"fields": null,
"inputFields": [
{
"name": "ownerId",
"description": "The ID of the organization that is running the migrations.",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
In my research I've read:
- How to use github graphql v4 api to query all repositories in my organization?
- Querying with GraphQL
- Postman Github API
- Introduction to GitHub GraphQL API
- How to create an issue on github using Postman with github api?
In Postman how can I get my org repositories with the Github API?