Created
June 23, 2018 04:08
-
-
Save alfianlosari/fd53c34a336099bba67274dff048b0dd to your computer and use it in GitHub Desktop.
React Apollo Github Pagination Trending Repositories Query
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
import gql from "graphql-tag"; | |
export const trendingRepositoriesGQLQuery = gql` | |
query search($query: String!, $cursor: String) { | |
search(first: 15, query: $query, type: REPOSITORY, after: $cursor) { | |
pageInfo { | |
startCursor | |
endCursor | |
hasNextPage | |
hasPreviousPage | |
} | |
edges { | |
node { | |
... on Repository { | |
name | |
owner { | |
login | |
} | |
description | |
stargazers { | |
totalCount | |
} | |
primaryLanguage { | |
name | |
} | |
} | |
} | |
} | |
} | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment