Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alfianlosari/fd53c34a336099bba67274dff048b0dd to your computer and use it in GitHub Desktop.
Save alfianlosari/fd53c34a336099bba67274dff048b0dd to your computer and use it in GitHub Desktop.
React Apollo Github Pagination Trending Repositories Query
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