Last active
October 8, 2023 20:22
-
-
Save ugurtekbas/308a9439ec77dddebd585f02dc8af59e to your computer and use it in GitHub Desktop.
Github GraphQL Search Queries
This file contains 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
fragment Repo on Repository { | |
id | |
name | |
description | |
stargazerCount | |
forkCount | |
updatedAt | |
createdAt | |
url | |
owner { | |
login | |
} | |
languages(first: 3) { | |
nodes { | |
name | |
color | |
} | |
} | |
} | |
fragment Page on PageInfo { | |
startCursor | |
endCursor | |
hasNextPage | |
hasPreviousPage | |
} | |
//search phrase could be "searchPhrase": "language:Kotlin forks:>10" | |
query SearchKotlinRepos($searchPhrase: String!) { | |
search( | |
query: $searchPhrase, | |
type: REPOSITORY, | |
first: 5 | |
) { | |
repositoryCount | |
nodes { | |
...Repo | |
} | |
pageInfo { | |
...Page | |
} | |
} | |
} | |
// requesting the next page after "endCursor" | |
query SearchKotlinReposNextPage($searchPhrase: String!, $endCursor: String) { | |
search( | |
query: $searchPhrase, | |
type: REPOSITORY, | |
first: 5, | |
after: $endCursor | |
) { | |
repositoryCount | |
nodes { | |
...Repo | |
} | |
pageInfo { | |
...Page | |
} | |
} | |
} | |
// requesting the previous page starting "startCursor" | |
query SearchKotlinReposPreviousPage($searchPhrase: String!, $startCursor: String) { | |
search( | |
query: $searchPhrase, | |
type: REPOSITORY, | |
last: 5, | |
before: $startCursor | |
) { | |
repositoryCount | |
nodes { | |
...Repo | |
} | |
pageInfo { | |
...Page | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment