Skip to content

Instantly share code, notes, and snippets.

@pchmn
Last active April 19, 2022 16:48
Show Gist options
  • Save pchmn/bcb573c1fca6760571eddfc615e98719 to your computer and use it in GitHub Desktop.
Save pchmn/bcb573c1fca6760571eddfc615e98719 to your computer and use it in GitHub Desktop.
Github GraphAPI Gist
# 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
}
}
@pchmn
Copy link
Author

pchmn commented Apr 19, 2022

test comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment