Last active
April 19, 2022 16:48
-
-
Save pchmn/bcb573c1fca6760571eddfc615e98719 to your computer and use it in GitHub Desktop.
Github GraphAPI Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Type queries into this side of the screen, and you will | |
# see intelligent typeaheads aware of the current GraphQL type schema, | |
# live syntax, and validation errors highlighted within the text. | |
# https://docs.github.com/en/graphql/overview/explorer | |
# We'll get you started with a simple query showing gists info! | |
query { | |
viewer { | |
gists (first: 100, orderBy: {field: CREATED_AT, direction: DESC} ) { | |
edges { | |
node { | |
createdAt | |
description | |
name | |
id | |
pushedAt | |
stargazers { | |
totalCount | |
} | |
files { | |
name | |
extension | |
text | |
} | |
updatedAt | |
} | |
} | |
} | |
} | |
} | |
# All starred repositories | |
query { | |
viewer { | |
starredRepositories( | |
first: 10 | |
orderBy: {field: STARRED_AT, direction: DESC} | |
) { | |
edges { | |
starredAt | |
cursor | |
node { | |
id | |
owner { | |
login | |
} | |
name | |
description | |
url | |
pushedAt | |
stargazerCount | |
forkCount | |
} | |
} | |
pageInfo { | |
endCursor | |
hasNextPage | |
startCursor | |
hasPreviousPage | |
} | |
totalCount | |
} | |
} | |
} | |
# starred repositories since last saved | |
query { | |
viewer { | |
starredRepositories( | |
first: 10, | |
before: ${lastCursor}, | |
orderBy: {field: STARRED_AT, direction: DESC} | |
) { | |
edges { | |
starredAt | |
cursor | |
node { | |
id | |
owner { | |
login | |
} | |
name | |
description | |
url | |
pushedAt | |
stargazerCount | |
forkCount | |
} | |
} | |
pageInfo { | |
endCursor | |
hasNextPage | |
startCursor | |
hasPreviousPage | |
} | |
totalCount | |
} | |
} | |
} | |
# get a speific repository | |
query { | |
repository(name: "core.js", owner: "octokit") { | |
forkCount | |
stargazerCount | |
description | |
url | |
pushedAt | |
viewerHasStarred | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
test comment