Skip to content

Instantly share code, notes, and snippets.

@tsukhu
Last active June 29, 2018 08:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tsukhu/15d5c9e4009bf27aa5bc95099f982009 to your computer and use it in GitHub Desktop.
Save tsukhu/15d5c9e4009bf27aa5bc95099f982009 to your computer and use it in GitHub Desktop.
react-git-explorer-gql
import { gql } from 'apollo-boost';
const GET_CURSOR_ORG_DATA = gql`
query($cursor: String, $org: String = "") {
organization(login: $org) {
repositories(
first: 50
after: $cursor
orderBy: { field: PUSHED_AT, direction: DESC }
) {
totalCount
pageInfo {
endCursor
__typename
}
edges {
cursor
node {
name
descriptionHTML
license
stargazers(first: 50) {
totalCount
}
repositoryTopics(first: 20) {
edges {
node {
topic {
name
}
}
}
}
forkCount
isFork
createdAt
updatedAt
pushedAt
homepageUrl
url
primaryLanguage {
name
color
}
collaborators(first: 50, affiliation: DIRECT) {
edges {
node {
name
login
avatarUrl
}
}
}
}
}
}
}
}
`;
const GET_ORG_DATA = gql`
query($org: String = "") {
organization(login: $org) {
repositories(first: 50, orderBy: { field: PUSHED_AT, direction: DESC }) {
totalCount
pageInfo {
endCursor
__typename
}
edges {
node {
name
descriptionHTML
license
stargazers(first: 50) {
totalCount
}
repositoryTopics(first: 20) {
edges {
node {
topic {
name
}
}
}
}
forkCount
isFork
createdAt
updatedAt
pushedAt
homepageUrl
url
primaryLanguage {
name
color
}
collaborators(first: 50, affiliation: DIRECT) {
edges {
node {
name
login
avatarUrl
}
}
}
}
}
}
}
}
`;
export { GET_CURSOR_ORG_DATA, GET_ORG_DATA };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment